1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/*
* @author lsy
* @date 2019-10-15
**/
class CountryBean {
int error;
String message;
Null extra;
List<Data> data;
UserType userType;
CountryBean({this.error, this.message, this.extra, this.data, this.userType});
CountryBean.fromJson(Map<String, dynamic> json) {
error = json['error'];
message = json['message'];
extra = json['extra'];
if (json['data'] != null) {
data = new List<Data>();
json['data'].forEach((v) {
data.add(new Data.fromJson(v));
});
}
userType = json['user_type'] != null
? new UserType.fromJson(json['user_type'])
: null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['error'] = this.error;
data['message'] = this.message;
data['extra'] = this.extra;
if (this.data != null) {
data['data'] = this.data.map((v) => v.toJson()).toList();
}
if (this.userType != null) {
data['user_type'] = this.userType.toJson();
}
return data;
}
}
class Data {
String title;
List<Countries> countries;
Data({this.title, this.countries});
Data.fromJson(Map<String, dynamic> json) {
title = json['title'];
if (json['countries'] != null) {
countries = new List<Countries>();
json['countries'].forEach((v) {
countries.add(new Countries.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['title'] = this.title;
if (this.countries != null) {
data['countries'] = this.countries.map((v) => v.toJson()).toList();
}
return data;
}
}
class Countries {
String id;
String name;
String language;
Countries({this.id, this.name, this.language});
Countries.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
language = json['language'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
data['language'] = this.language;
return data;
}
}
class UserType {
UserType();
UserType.fromJson(Map<String, dynamic> json) {}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
return data;
}
}