PhoneCountryData.fromMap constructor
PhoneCountryData.fromMap(
- Map value, {
- String lang = '',
})
Implementation
factory PhoneCountryData.fromMap(
Map value, {
String lang = '',
}) {
final countryData = PhoneCountryData._init(
country: value['country$lang'],
/// not all countryDatas need to separate phoneCode and
/// internalPhoneCode. In most cases they are the same
/// so we only need to check if the field is present and set
/// the dafult one if not
phoneCode: value['phoneCode'] ?? value['internalPhoneCode'],
internalPhoneCode: value['internalPhoneCode'],
countryCode: value['countryCode'],
phoneMask: value['phoneMask'],
altMasks: value['altMasks'],
);
return countryData;
}