formatPhoneNumber static method

String? formatPhoneNumber(
  1. String phoneNumber
)

Implementation

static String? formatPhoneNumber(String phoneNumber) {
  if (!_mobileRegex.hasMatch(phoneNumber)) return null;
  final RegExpMatch match = _mobileRegex.firstMatch(phoneNumber)!;
  return "+98${match.group(1)}-${match.group(2)}-${match.group(3)}";
}