Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit available countries #234

Closed
quiquegarcia opened this issue Nov 3, 2022 · 3 comments
Closed

Limit available countries #234

quiquegarcia opened this issue Nov 3, 2022 · 3 comments

Comments

@quiquegarcia
Copy link

Configuration to limit or exclude available countries on search and drop down.

@quiquegarcia
Copy link
Author

Just saw that there is a countries parameter that receives a list of 2 letter country codes to limit, this must be in the documentation 😄

IntlPhoneField(
    decoration: InputDecoration(
        labelText: 'Phone Number',
        border: OutlineInputBorder(
            borderSide: BorderSide(),
        ),
    ),
    initialCountryCode: 'IN',
    countries: ['PE', 'MX', 'SN'],
    onChanged: (phone) {
        print(phone.completeNumber);
    },
)

@ydedev
Copy link

ydedev commented Jul 21, 2023

The element type 'String' can't be assigned to the list type 'Country'.

@ZahidTekbas
Copy link

Countries attribute changed lately and it needs Country variable instead of String. How can we limit available countries in the latest version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants