LokotroCountry.fromJson constructor

LokotroCountry.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory LokotroCountry.fromJson(Map<String, dynamic> json) {
  return LokotroCountry(
    refCountry: LokotroRefCountry.fromJson(
      json['ref_country'] as Map<String, dynamic>? ?? {},
    ),
    countryCodes: (json['country_codes'] as List<dynamic>?)
        ?.map((e) => LokotroCountryCode.fromJson(e as Map<String, dynamic>))
        .toList() ?? [],
    phoneNumberPrefixes: (json['phone_number_prefixes'] as List<dynamic>?)
        ?.map((e) => LokotroPhonePrefix.fromJson(e as Map<String, dynamic>))
        .toList() ?? [],
  );
}