formatters/phone_input_formatter library
Functions
-
formatAsPhoneNumber(
String phone, {InvalidPhoneAction invalidPhoneAction = InvalidPhoneAction.ShowUnformatted, bool allowEndlessPhone = false, String? defaultMask, String? defaultCountryCode}) → String? -
allowEndlessPhoneif this is true, the -
getCountryDatasByPhone(
String phone) → List< PhoneCountryData> -
returns a list of country datas with a country code of
the supplied phone number. The return type is List because
many countries and territories may share the same phone code
the list will contain one PhoneCountryData at max
returnsA list of PhoneCountryData datas or an empty list -
isPhoneValid(
String phone, {bool allowEndlessPhone = false, String? defaultCountryCode}) → bool