I want to get full number from IntlPhoneField
(package intl_phone_field
)
I use controller to get number. but it not includes country code,
IntlPhoneField(
disableLengthCheck: true,
controller: phoneNumberCon,
decoration: InputDecoration(
hintText: 'Phone Number',
),
),
I tried,
String input = phoneNumberCon.text.trim();
String finalone = "${phone.countrycode} + $input";
It not working because phone.countrycode
is not working.
2
Answers
You can use
onChanged
method and try to pass out its value like this, First define new variable like this:then try this:
Have you checked the capitalisation required by the library?
You have written:
Should it be this?