Facing issue in formatting number
I am retrieving contacts from my phone and parsing it using formatNumberSync function to format phone number now I am facing an issue with country codes. Let suppose some of my contacts have country code in it and some contacts don't have country code in it. How you handle this thing? As the number being parsed it plain String lie "1234567890" or "+11234567980". Now how can I handle this thing.
Thanks!
It's a tricky thing. There's no real solution since you have to know the country code to correctly parse it. The best you can do is guess which is what the package tries to do.
A safe approach is to default to the device locale to get the country code, because you can reasonably assume local numbers to the device probably don't have the country code saved for most cases.