normalizedDialingCode function

String normalizedDialingCode(
  1. Country country
)

Returns a country calling code with exactly one leading +.

Implementation

String normalizedDialingCode(Country country) {
  final code = country.phoneCode?.trim() ?? '';
  return code.isEmpty ? '' : '+${code.replaceFirst(RegExp(r'^\++'), '')}';
}