phone_number
phone_number copied to clipboard
Implementing Web support
This pull request is linked to issue #44. Here you can find, an implementation of your plugin for web using google libphonenumber js library using https://github.com/natintosh/plugin_libphonenumber/tree/develop/libphonenumber_web as a starting point.
There is a deprecated call on MethodChannel constructor with Registrar.messenger, but I failed to get the plugin to work without using it.
Hi there! Sorry for the late reply.. I've tried the code in this PR and unfortunately, I found an issue right from the start by trying to parse an international number, without providing a region code. it works with the native sdks, but the web sdk just fails. The libphonenumber's JS implementation might not be ready yet. Do you have the same results ?
Hello, I don't remember if I had this results. I have made some tests and everything seemed to work fine. I will try to reproduce your issue and probably fix it.
I find the problem and fix it (I was forcing regionCode to not be null when parsing international phone numbers). Tell me if you still encountered this issue or if you find another. If you can provide me any scenarios to test in order to correct the rest of my code, it will be nice.
I find two other issues :
- carrierRegionCode() : I can't get the carrier RegionCode with libphonenumber but I can try to get current browser region if you want
- getAllSupportedRegions() : I can't get the display names from RegionCode in dart or with libphonenumber. I can try to use some js code (using Intl.DisplayNames) or a flutter package (locale_names which is not null safe)
Hey all, is this planned on being merged soon?
Is there any update on this merge?
Take a look on this @gabriel8belts https://github.com/flutter-form-builder-ecosystem/phone_number/issues/86