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

Get ISO2Code from phone number string #372

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

alexviquez
Copy link

@alexviquez alexviquez commented Feb 19, 2023

Instaed of passing just the prefix, you can pass the whole phone number to extract the ISOCode, this helps in case you just want to know the isocode and then build the PhoneNumber from string or get the dial code

Instaed of passing just the prefix, you can pass the whole phone number to extract the ISOCode, this helps in case you just want to know the isocode and then build the PhoneNumber from string
@alexviquez alexviquez changed the title Get ISO2Code from phone number Get ISO2Code from phone number string Feb 19, 2023
@@ -108,7 +108,7 @@ class PhoneNumber extends Equatable {
if (prefix.isNotEmpty) {
prefix = prefix.startsWith('+') ? prefix : '+$prefix';
var country = Countries.countryList
.firstWhereOrNull((country) => country['dial_code'] == prefix);
.firstWhereOrNull((country) => prefix.contains(country['dial_code']);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing one more bracket at the end

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi!, no need more brackets, what are you talking about?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at the end of 111

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh you are right!

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

Successfully merging this pull request may close these issues.

2 participants