Country.fromJson constructor

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

Implementation

factory Country.fromJson(Map<String, dynamic> json) {
  return Country(
    countryID: json['countryID'],
    name: json['name'],
    countryCode: json['countryCode'],
    phoneCode: json['phoneCode'],
    provinceList: json['provinceList'] != null
        ? (json['provinceList'] as List<dynamic>?)
            ?.map((friendJson) => Province.fromJson(friendJson))
            .toList()
        : null,
  );
}