Country.fromJson constructor

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

Implementation

Country.fromJson(Map<String, dynamic> json) {
  id = json['id'];
  name = json['name'];
  nameAr = json['name_ar'];
  emoji = json['emoji'];
  emojiU = json['emojiU'];
  iso2 = json['iso2'];
  iso3 = json['iso3'];
  countrycode = json['countrycode'];
  frenchname = json['frenchname'];
  if (json['state'] != null) {
    state = [];
    json['state'].forEach((v) {
      state!.add(Region.fromJson(v));
    });
  }
}