Coder Social home page Coder Social logo

Comments (9)

natintosh avatar natintosh commented on July 2, 2024

@illiashvedov I recreated this at my end at it works could you shed more light on this matter

from intl_phone_number_input.

illiashvedov avatar illiashvedov commented on July 2, 2024

If you set the default country this way, then I can’t enter anything into the number line, but if the phone number was given to me, then it always displays as the wrong number, although if you select the text field and then cancel it, the check says that the number is valid.

from intl_phone_number_input.

natintosh avatar natintosh commented on July 2, 2024

If I get this right, I believe what you are trying to say is that anytime you set a new state for the initial value with a valid phone number you get a validation error, right?

from intl_phone_number_input.

illiashvedov avatar illiashvedov commented on July 2, 2024

Yes

from intl_phone_number_input.

natintosh avatar natintosh commented on July 2, 2024

I just pushed a fix Thanks πŸ‘.

from intl_phone_number_input.

yusuf-umar avatar yusuf-umar commented on July 2, 2024

hi, bellow is my code but i keep getting invalid phone number. when i input the correct phone number

InternationalPhoneNumberInput(
onInputChanged: (PhoneNumber number) {
// print(number.phoneNumber);
},
onInputValidated: (bool value) {
print(value);
},
selectorConfig: SelectorConfig(
selectorType: PhoneInputSelectorType.DIALOG,
),
ignoreBlank: false,
autoValidateMode: AutovalidateMode.disabled,
selectorTextStyle: TextStyle(color: Colors.black),
initialValue: number,
textFieldController: controller,
formatInput: true,
keyboardType: TextInputType.numberWithOptions(
signed: true, decimal: true),
inputBorder: InputBorder.none,
// border: InputBorder.none,
onSaved: (PhoneNumber number) {
print('On Saved: $number');
},
),

from intl_phone_number_input.

kehindemary avatar kehindemary commented on July 2, 2024

I get the same error

from intl_phone_number_input.

yusuf-umar avatar yusuf-umar commented on July 2, 2024

I get the same error

hi, i was able to solved error by adding a validator, to the widget.
... sample
borderRadius: BorderRadius.circular(5)),
child: InternationalPhoneNumberInput(
validator: _phoneValidator, // add this line. then declare you _phoneValidator function somewhere
onInputChanged: (PhoneNumber number) {
// print(number.phoneNumber);
},

.....

.......

String? _phoneValidator(value) {
if (value!.length < 6) {
return "Please enter correct phone number";
} else {
return null;
}
}

from intl_phone_number_input.

kehindemary avatar kehindemary commented on July 2, 2024

Thank you Yusuf, I tried it still got the red textfield
err

from intl_phone_number_input.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.