Closed JoshanTandukar closed 1 year ago
isValidPhoneNumber is from the lib phone number package i can't see that its in this flutter_libphonenumber package please let me know if i'm wrong because I'd appreciate it being moved into this package so we can migrate fully from that to this
@martipello you can do the same by calling parse
and if you get a null result then it's not a valid number, if it is valid it would return the country info associated with it.
@martipello you can do the same by calling
parse
and if you get a null result then it's not a valid number, if it is valid it would return the country info associated with it.
Very cool I will do just that, many thanks
@acoutts it cant return null do you mean if it throws? or do we mean getFormattedParseResult? in fact it kind of looks like getFormattedParseResult calls parse and if it throws returns null, so just use getFormattedParseResult and check if its null
sorry you're right, but that's correct. just check the error when you pass a bad number to it and catch that accordingly.
+9779861eeeeee this number seems sure invalid. However, if passed to , await PhoneNumberUtil.isValidPhoneNumber( phoneNumber: phone, isoCode: selectedCountryCode.code!, );