niinyarko / flutter-international-phone-input Goto Github PK
View Code? Open in Web Editor NEWInternational Phone Number Input For Flutter
License: MIT License
International Phone Number Input For Flutter
License: MIT License
It would be super useful to limit the number of digits that can be inputted into the field.
like
TextField(
maxLength: widget.maxDigits??null,
)
I know the code but I have never contributed before. Please, someone, add this functionality or help me do it.
The test
dependency should be moved from dependencies
to dev_dependencies
. (Isn't it only for testing, and not a runtime dependency?)
Hi, please provide this sorting functionality or search functionality for countries, it will be difficult to user to scroll through all the countries. Right now, the sorting is based on country names but we are not displaying country names. At least, give option to display country name.
thanks.
Would be nice to detect location with the locator / geolocation / locale package, and preselect country code based on the results.
Hello brother,
I'm very appreciative to use your library, it's very convenient and useful.
But I have a problem when I use your library, can you help me fix it? Thanks a lot.
I'm quite hard to find my country on your drop down list, so I think that if you can add search bar on country finding drop down list, it will help better user experience.
Thanks for reading my issue.
Best regards,
Thank you.
can you please expose the style property on the textField? I needed to customise the phone text
I am getting this error " Unhandled Exception: setState() called after dispose(): _InternationalPhoneInputState#a2d65 "
how can I solve this?
just replace Colors.white
in input_widget.dart ...
with this:
MediaQuery.of(context).platformBrightness == Brightness.dark ? Color(0xff212121) : Colors.white
for dark mode ..
There is no overridden dispose method in International Phone Input which can cause disposal of Text editing controller. Please add the same :)
Hi, your library very nice.. but how i can show a few country in dropdown? not displaying all countries only a few that I want to show
Thank you,
how can I input phone number ?
The phone number prints correctly once it is verified. However if I delete a single digit from the phone number so that it is no longer valid, onPhoneNumberChange runs twice. First an empty string is printed (as expected) but right after that it prints the entire number as if nothing was deleted from the end. Here's my method
void onPhoneNumberChange(String number, String internationalizedPhoneNumber, String isoCode) {
setState(() {
phoneNumber = internationalizedPhoneNumber;
print(number);
});
}
InternationalPhoneInput(
onPhoneNumberChange: onPhoneNumberChange,
initialPhoneNumber: phoneNumber,
initialSelection: 'US',
),
There is no way one can determine when the field is focused or request focus on the field without doing much. I would suggest this attribute passed on through a property or some sort.
I would like to add a label to the TextField widget in the InternationalPhoneInput widget. Allowing a positional parameter to pass in an optional labelText would add this feature quite easily
Will be great if we can sort like this
+1 Canada
+7 US
+20 Egypt
+27 South Africa
I had to look it up for the updated dart and pubspec files for the urls. It would be better to include those into the readme file for an easy installation.
when i am running my app in debug mode. I am getting following error
`The following NoSuchMethodError was thrown while dispatching notifications for TextEditingController:
The getter 'code' was called on null.
Receiver: null
Tried calling: code
When the exception was thrown, this was the stack
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
#1 _InternationalPhoneInputState._validatePhoneNumber
package:international_phone_input/src/international_phone_input.dart:127
#2 ChangeNotifier.notifyListeners
package:flutter/…/foundation/change_notifier.dart:207
#3 ValueNotifier.value=
package:flutter/…/foundation/change_notifier.dart:274
#4 EditableTextState._value=
package:flutter/…/widgets/editable_text.dart:1459
...
The TextEditingController sending notification was: TextEditingController#3cc2e(TextEditingValue(text: ┤9├, selection: TextSelection(baseOffset: 1, extentOffset: 1, affinity: TextAffinity.downstream, isDirectional: false), composing: TextRange(start: -1, end: -1)))`
Gives last user input when a number in textFeild is one number less than the required size && this happens when back button in
the phone is pressed instead of the tick button on the keyboard.
That is even if the TextFeild has only 9 letters we get an output of 10 that is the previous valid one which is kind of an Error for validation
(NB: New to flutter, so I can't say am right, correct me if am wrong )
How do I make sure that the number phone is correct and not empty in method InternationalPhoneInput ?
Would be nice to see country names as well.
the onInputValidated function always returns false, even if the phone number is correct.
try to make (const widgets list of the countries) instead of building (the countries list) every time we press the button , it will make the plugin very fast , and improve the performance of the app ..
add auto detect country code using (Location service) .. , i can help .., but i never developed a plugin , and don't know how to upload it ..
in the filed using this code will deted the system country code (imported from dart:io package)
initialCountry2LetterCode: Platform.localeName.split('_')[1].toString()
migrate this pub in null safety.
if you are not interested in null safety, please declare in pub.dev for no longer provide null safety
Thank You
Is there a way to pass TextEditingController
into InternationalPhoneInput
?
I would like to be able to change the text inside.
User wants an option for using phone validation. There might be a case to input custom numbers that may not be able to validate by this plugin.
i am using gelocator plugin to get the current location. So, based on that i need to make the initialSelection corresponding to the location countryISO. But when i tried its not updating.
Can i know what could be wrong?
Below is my code to set the initialSelection.
List<Placemark> p = await geolocator.placemarkFromCoordinates(
_currentPosition.latitude, _currentPosition.longitude);
Placemark place = p[0];
setState(() {
countryCode = place.isoCountryCode;
});
InternationalPhoneInput(
onPhoneNumberChange: _onPhoneNumberChanged,
initialSelection: countryCode,
errorText:"Please type a valid phone number",
errorMaxLines:4,
),);
+263 as the country code, this mobile number 788930137 is not recognized.
Hello,
thanks for the component, it is great!
I would like to add these properties to the TextFields
**[fillColor, Opacity, and filled]
InputDecoration(
fillColor: Colors.transparent.withOpacity(0.5),
filled:true,**
can you add it or if i do it on a branch will you merge it into the package? I dont have much experience with contributing!
Thanks :)
Andy ink
Thank for the awesome work on this plugin.
I want to get the value of the selected country when it change.
How can i achieve this ?
Plugin version : ^0.7.0+1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.