get_board_model.dart
1.79 KB
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
class FeastBoardModel {
String title;
Map<String, List<FeastBoardSunModel>> data;
FeastBoardModel({this.title, this.data});
FeastBoardModel.fromJson(Map<String, dynamic> json) {
data = {};
json.forEach((key, value) {
List<FeastBoardSunModel> temp = [];
value.forEach((element) {
FeastBoardSunModel sunModel = new FeastBoardSunModel.fromJson(element);
temp.add(sunModel);
});
data[key] = temp;
});
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['title'] = this.title;
data['data'] = this.data;
return data;
}
}
class FeastBoardSunModel {
String rname;
String id;
String rid;
String className;
String nickName;
String account;
String talbeStr;
String lost;
String get talbeStrShow {
if (talbeStr.endsWith('、')) {
return talbeStr.substring(0, talbeStr.length - 1);
}
return talbeStr;
}
FeastBoardSunModel(
{this.rname,
this.id,
this.rid,
this.className,
this.nickName,
this.account,
this.talbeStr,
this.lost});
FeastBoardSunModel.fromJson(Map<String, dynamic> json) {
rname = json['rname'];
id = json['id'];
rid = json['rid'];
className = json['class_name'];
nickName = json['nick_name'];
account = json['account'];
talbeStr = json['talbeStr'];
lost = json['lost'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['rname'] = this.rname;
data['id'] = this.id;
data['rid'] = this.rid;
data['class_name'] = this.className;
data['nick_name'] = this.nickName;
data['account'] = this.account;
data['talbeStr'] = this.talbeStr;
data['lost'] = this.lost;
return data;
}
}