I’m trying to figure out how to disable country selection using IntlPhoneField
I tried to pass in countries: country code, but it gives an error:
The element type ‘String’ can’t be assigned to the list type ‘Country’.
I tried to pass in countries: country code, but it gives an error:
The element type ‘String’ can’t be assigned to the list type ‘Country’.
2
Answers
You can add
enabled : false
to disable the field.there is other option like
readOnly: true
to disable user input.It accepts list of type
Country
.If you want to pass countries manually you should define countries like this.
Country model has been defined in the above package like this:
If you don’t want to add countries by yourself, just don’t define the parameter
countries
.