app-starlock/lib/login/selectCountryRegion/common/countryRegionEntity.dart

82 lines
1.9 KiB
Dart
Executable File

import 'dart:convert';
import 'package:azlistview/azlistview.dart';
class CountryRegionEntity {
CountryRegionEntity(
{this.errorCode, this.description, this.errorMsg, this.dataList});
CountryRegionEntity.fromJson(Map<String, dynamic> json) {
errorCode = json['errorCode'];
description = json['description'];
errorMsg = json['errorMsg'];
if (json['data'] != null) {
dataList = <CountryRegionModel>[];
json['data'].forEach((v) {
dataList!.add(CountryRegionModel.fromJson(v));
});
}
}
int? errorCode;
String? description;
String? errorMsg;
List<CountryRegionModel>? dataList;
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
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<String, dynamic> 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<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
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);
}