intl_phone_number_input
intl_phone_number_input copied to clipboard
validation error on Saudi Arabia number
Describe the bug It only accepts numbers starting with 11, but 11 is the landline area code for Riyadh and I want to include other landline area codes too
Package version intl_phone_number_input: ^0.7.0+2
Flutter version Flutter 2.5.1 • channel stable • https://github.com/flutter/flutter.git Framework • revision ffb2ecea52 (3 weeks ago) • 2021-09-17 15:26:33 -0400 Engine • revision b3af521a05 Tools • Dart 2.14.2
To Reproduce Steps to reproduce the behavior:
-
Obx( () { return InternationalPhoneNumberInput( selectorConfig: const SelectorConfig( selectorType: PhoneInputSelectorType.DIALOG, setSelectorButtonAsPrefixIcon: false, leadingPadding: 10, trailingSpace: false, ), initialValue: controller.phoneNo, spaceBetweenSelectorAndTextField: 0, maxLength: digit.value, // key: controller.phonekey, onInputChanged: (number) { // controller.phonekey.currentState!.validate(); controller.phoneNo = number; // if(number.toString().trim().contains("+966")) // { // digit.value = 11; // } // else // { // digit.value = 12; // } // print(controller.phoneNo); }, // validator: (val) { // if(!controller.isValidPhone!.value) // { // return "Please provide valid number"; // } // }, errorMessage: "Please provide valid number", inputDecoration: AppTheme.textFormFeildInputDecoration( hintText: "1234567890", labelText: "Phone Number", ), formatInput: true, onInputValidated: (val) { controller.isValidPhone!.value = val; // print(controller.isValidPhone!.value); }, countries: ["IN","SA"], ); } ),
-
i want a phone feild with indian and saudi arabia numbers , the indian validation is working fine but it is not able to validate the saudi arabic numbers
-
on input other than numbers starting with 11 it gives an error
-
validation error
Expected behavior i want to validate SA numbers
Screenshots If applicable, add screenshots to help explain your problem.
** Targeted platforms (please complete the following information):** I have tested in Android OS
- OS
- Web [✔ or ❌]
Additional context Add any other context about the problem here.
I'm facing the same issue and since there's no fix yet, I've written my custom validator using validator:
param.