knowledge_model.dart
1.03 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
class KnowledgeModel {
String title;
String subTitle;
String content;
int id;
int uid;
int platform;
int updateAt;
int createAt;
KnowledgeModel(
{this.title,
this.subTitle,
this.content,
this.id,
this.uid,
this.platform,
this.updateAt,
this.createAt});
KnowledgeModel.fromJson(Map<String, dynamic> json) {
this.title = json['title'];
this.subTitle = json['sub_title'];
this.content = json['content'];
this.id = json['id'];
this.uid = json['uid'];
this.platform = json['platform'];
this.updateAt = json['update_at'];
this.createAt = json['create_at'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['title'] = this.title;
data['sub_title'] = this.subTitle;
data['content'] = this.content;
data['id'] = this.id;
data['uid'] = this.uid;
data['platform'] = this.platform;
data['update_at'] = this.updateAt;
data['create_at'] = this.createAt;
return data;
}
}