getParsableNumber static method
Implementation
static Future<String> getParsableNumber(PhoneNumberTest phoneNumber) async {
if (phoneNumber.isoCode != null) {
PhoneNumberTest number = await getRegionInfoFromPhoneNumber(
phoneNumber.phoneNumber!,
phoneNumber.isoCode!,
);
String? formattedNumber = await PhoneNumberUtil.formatAsYouType(
phoneNumber: number.phoneNumber!,
isoCode: number.isoCode!,
);
return formattedNumber!.replaceAll(
RegExp('^([\\+]?${number.dialCode}[\\s]?)'),
'',
);
} else {
throw new Exception('ISO Code is "${phoneNumber.isoCode}"');
}
}