Houzi Docs logo Houzi Docs

Houzi provides the CustomCountryHook() to customize the country list available in the phone signup page. This hook allows you to either:

How It Works

The CustomCountryHook() returns a function that provides a list of Country objects. This list defines which countries (and their respective phone codes) should be shown in the phone number field.

CustomCountryHook getCustomCountryHook() {
  CustomCountryHook customCountryHook = () {
    List<Country> countryList = [
      Country(
        code: "PK",
        dialCode: "92",
        name: "Pakistan",
        flag: 'πŸ‡΅πŸ‡°',
        nameTranslations: {},
        minLength: 10,
        maxLength: 10,
      ),
      Country(
        code: "RU",
        dialCode: "7",
        name: "Russia",
        flag: 'πŸ‡·πŸ‡Ί',
        nameTranslations: {},
        minLength: 10,
        maxLength: 10,
      ),
    ];

    // Return this list to show only selected countries
    // return countryList;

    // Return null to show all countries by default
    return null;
  };

  return customCountryHook;
}

Country Field Reference Table

Property Description Example
code 2-letter ISO country code "PK" for Pakistan
dialCode Country calling code "92"
name Country name "Pakistan"
flag Country flag emoji 'πŸ‡΅πŸ‡°'
nameTranslations Country name translations (can be empty) {}
minLength Minimum phone number length 10
maxLength Maximum phone number length 10

Emoji Tips for Flags

To correctly display country flags using emoji, follow the platform-specific instructions below:

On macOS:

On Windows:

⚠️ Important
Ensure you’re using valid Regional Indicator Symbols.
Using incorrect or unsupported emoji may result in display/rendering issues or show as blank squares or placeholders.

After modifications, restart the app and the changes will reflect in your app.

Added in version 1.4.4

Previous: Hide Fields in Edit Profile Next: Home Background Hook