countryCodePlusFormat function

String countryCodePlusFormat(
  1. String number
)

countryCodePlusFormat

Returns the phone number with country code format +263. @throws LocalRegexException if the given number is not a valid number.

Implementation

String countryCodePlusFormat(String number) {
  if (number.length < 9) {
    throw LocalRegexException('Phone number length cannot be less than 9');
  }

  final phoneNumber = number.substring(number.length - 9);
  return '+263${phoneNumber.clean}';
}