Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to preselect country code based on geolocation / locale? #12

Open
giorgio79 opened this issue Mar 11, 2020 · 2 comments
Open

Try to preselect country code based on geolocation / locale? #12

giorgio79 opened this issue Mar 11, 2020 · 2 comments

Comments

@giorgio79
Copy link

Would be nice to detect location with the locator / geolocation / locale package, and preselect country code based on the results.

@niinyarko
Copy link
Owner

Would be nice to detect location with the locator / geolocation / locale package, and preselect country code based on the results.

Cool 🙇

@lohithkumar95
Copy link

Hi @niinyarko is that been implemented?
i am stuck with this for long time.
I am setting the countryCode with the current location iso.But its not updating. Please find below code.

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,
           ),);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants