Country.fromJson constructor

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

Implementation

factory Country.fromJson(Map<String, dynamic> json) {
  return Country(
    id: json['id'],
    lang: json['lang'],
    code: json['code'],
    alpha3Code: json['alpha3_code'],
    name: json['name'],
    allowedDocs: List<String>.from(json['allowed_docs']),
    flag: json['flag'],
    avatar: json['avatar'],
    documents: (json['documents'] as List)
        .map((doc) => DocumentType.fromJson(doc))
        .toList(),
  );
}