class MessageListEntity { List rows; int total; int size; int current; String readCount; String unreadCount; bool searchCount; int pages; MessageListEntity.fromJsonMap(Map map): rows = List.from(map["records"].map((it) => MessageListItem.fromJsonMap(it))), total = map["total"], size = map["size"], current = map["current"], readCount = map["readCount"], unreadCount = map["unreadCount"], searchCount = map["searchCount"], pages = map["pages"]; Map toJson() { final Map data = new Map(); data['records'] = rows != null ? this.rows.map((v) => v.toJson()).toList() : null; data['total'] = total; data['size'] = size; data['current'] = current; data['readCount'] = readCount; data['unreadCount'] = unreadCount; data['searchCount'] = searchCount; data['pages'] = pages; return data; } } class MessageListItem { String id; String userId; String content; int type; int viewFlag; int deviceModel; String createUserId; String createTime; MessageListItem({ this.id="" }); MessageListItem.fromJsonMap(Map map): id = map["id"], userId = map["userId"], content = map["content"], type = map["type"], viewFlag = map["viewFlag"], deviceModel = map["deviceModel"], createUserId = map["createUserId"], createTime = map["createTime"]; Map toJson() { final Map data = new Map(); data['id'] = id; data['userId'] = userId; data['content'] = content; data['type'] = type; data['viewFlag'] = viewFlag; data['deviceModel'] = deviceModel; data['createUserId'] = createUserId; data['createTime'] = createTime; return data; } }