class AppConfig { String? ver; List? items; AppConfig({this.ver, this.items}); AppConfig.fromJson(Map json) { ver = json['ver']; if (json['items'] != null) { items = []; json['items'].forEach((v) { items!.add(AppConfigItem.fromJson(v)); }); } } Map toJson() { final Map data = {}; data['ver'] = ver; if (items != null) { data['items'] = items!.map((v) => v.toJson()).toList(); } return data; } } class AppConfigItem { dynamic data; String? name; AppConfigItem({this.data, name}); AppConfigItem.fromJson(Map json) { data = json['data']; name = json['name']; } Map toJson() { final Map json = {}; json['data'] = data; json['name'] = name; return json; } }