List jsonToList(list){ List contList=[]; list.forEach((item){ contList.add(ExtendContent.fromJson(item)); }); return contList; } class NewsInformationInfoTextModel { String? createDate; String? newsId; num? status; String? thumb; String? title; String? typeId; String? typeName; num? weight; List? contentList=[]; NewsInformationInfoTextModel(); NewsInformationInfoTextModel.fromJson(Map json) : newsId = json["newsId"], title = json["title"], typeId = json["typeId"], typeName = json["typeName"], thumb = json["thumb"], weight = json["weight"], status = json["status"], createDate = json["createDate"], contentList= jsonToList(json["contentList"]); Map toJson() => { 'newsId': newsId, 'title': title, 'typeId': typeId, 'typeName': typeName, 'thumb': thumb, 'weight': weight, 'status': status, 'createDate': createDate, }; } class ExtendContent { String? content; String? contentType; String? createDate; String? extId; num? sort; String? targetId; String? targetType; ExtendContent(); ExtendContent.fromJson(Map json) : content = json["content"], contentType = json["contentType"], createDate = json["createDate"], extId = json["extId"], sort = json["sort"], targetId = json["targetId"], targetType = json["targetType;"]; Map toJson() => { 'content': content, 'contentType': contentType, 'createDate': createDate, 'extId': extId, 'sort': sort, 'targetId': targetId, 'targetType': targetType, }; }