Home > Software engineering >  Flutter Phone Number - intl_phone_number package
Flutter Phone Number - intl_phone_number package

Time:06-30

  InternationalPhoneNumberInput(
          onInputChanged: onInputChanged,
          cursorColor: kDarkGreyColor,
          initialValue: phoneNumber, // 961 or 961
          hintText: 'Phone Number',
...

I want to set the initial value of the flag selector to my country 961 However initial value is not working? How do i set the initial value country code

enter image description here

CodePudding user response:

it worked as follows

initialValue: PhoneNumber(isoCode: 'LB', dialCode:' 961'),

...

CodePudding user response:

When you create a phone number add an Iso code like the following

PhoneNumber number = PhoneNumber(isoCode: 'LB');//lebanon's iso code
  • Related