class NoticeListModel { String code; String msg; List data; NoticeListModel({this.code, this.msg, this.data}); NoticeListModel.fromJson(Map json) { code = json['code']; msg = json['msg']; if (json['data'] != null) { data = []; json['data'].forEach((v) { data.add(new NoticeData.fromJson(v)); }); } } Map toJson() { final Map data = new Map(); data['code'] = this.code; data['msg'] = this.msg; if (this.data != null) { data['data'] = this.data.map((v) => v.toJson()).toList(); } return data; } } class NoticeData { num id; int type; num userId; String content; String creatTime; int isShow; NoticeData( {this.id, this.type, this.userId, this.content, this.creatTime, this.isShow}); NoticeData.fromJson(Map json) { id = json['id']; type = json['type']; userId = json['userId']; content = json['content']; creatTime = json['creatTime']; isShow = json['isShow']; } Map toJson() { final Map data = new Map(); data['id'] = this.id; data['type'] = this.type; data['userId'] = this.userId; data['content'] = this.content; data['creatTime'] = this.creatTime; data['isShow'] = this.isShow; return data; } }