class CateModel { List result; CateModel({this.result}); CateModel.fromJson(Map json) { if (json['result'] != null) { result = new List(); json['result'].forEach((v) { result.add(new CateItemModel.fromJson(v)); }); } } Map toJson() { final Map data = new Map(); if (this.result != null) { data['result'] = this.result.map((v) => v.toJson()).toList(); } return data; } } class CateItemModel { String sId; String title; Object status; String pic; String pid; String sort; CateItemModel({this.sId, this.title, this.status, this.pic, this.pid, this.sort}); CateItemModel.fromJson(Map json) { sId = json['_id']; title = json['title']; status = json['status']; pic = json['pic']; pid = json['pid']; sort = json['sort']; } Map toJson() { final Map data = new Map(); data['_id'] = this.sId; data['title'] = this.title; data['status'] = this.status; data['pic'] = this.pic; data['pid'] = this.pid; data['sort'] = this.sort; return data; } }