CountryCode.fromMap constructor

CountryCode.fromMap(
  1. Map<String, dynamic> map
)

Converts the country code from map to the actual item.

Implementation

factory CountryCode.fromMap(Map<String, dynamic> map) {
  return CountryCode(
    name: map['name'] as String? ?? 'United States',
    code: map['code'] as String? ?? 'US',
    dialCode: map['dial_code'] as String? ?? '+1',
    nationalSignificantNumber: map['national_significant_number'] as int?,
  );
}