import 'dart:convert'; import 'package:azlistview/azlistview.dart'; class CountryRegionEntity { CountryRegionEntity( {this.errorCode, this.description, this.errorMsg, this.dataList}); CountryRegionEntity.fromJson(Map json) { errorCode = json['errorCode']; description = json['description']; errorMsg = json['errorMsg']; if (json['data'] != null) { dataList = []; json['data'].forEach((v) { dataList!.add(CountryRegionModel.fromJson(v)); }); } } int? errorCode; String? description; String? errorMsg; List? dataList; Map toJson() { final Map data = {}; data['errorCode'] = errorCode; data['description'] = description; data['errorMsg'] = errorMsg; if (dataList != null) { data['data'] = dataList!.map((v) => v.toJson()).toList(); } return data; } } class CountryRegionModel extends ISuspensionBean { CountryRegionModel( {this.countryId, this.name, this.code, this.flag, this.abbreviation, this.group, this.tagIndex}); CountryRegionModel.fromJson(Map json) { countryId = json['countryId']; name = json['name']; code = json['code']; flag = json['flag']; abbreviation = json['abbreviation']; group = json['group']; } int? countryId; String? name; String? code; String? flag; String? abbreviation; String? group; String? tagIndex; Map toJson() { final Map data = {}; data['countryId'] = countryId; data['name'] = name; data['code'] = code; data['flag'] = flag; data['abbreviation'] = abbreviation; data['group'] = group; return data; } @override String getSuspensionTag() => tagIndex!; @override String toString() => json.encode(this); }