2026-04-09 21:32:23 +08:00

158 lines
6.8 KiB
Dart

/// openCountry : [{"aliasName":"India","alphaThree":"IND","alphaTwo":"IN","countryName":"India","enName":"India","id":"1231833304232112130","nationalFlag":"https://dev.file.momooline.com/other/manager-2d956fa5-3a17-4af7-95c4-42d4b4f1161c.png","open":true,"phonePrefix":91,"top":false},{"aliasName":"Iran","alphaThree":"IRN","alphaTwo":"IR","countryName":"Iran, Islamic Republic of","enName":"Iran","id":"1231833306144714754","nationalFlag":"https://dev.file.momooline.com/other/manager-108be79c-0c8e-4b19-9147-fb2514e1828e.png","open":true,"phonePrefix":98,"top":false},{"aliasName":"Italy","alphaThree":"ITA","alphaTwo":"IT","countryName":"Italy","enName":"Italy","id":"1231833307491086337","nationalFlag":"https://dev.file.momooline.com/other/manager-0d7a19f5-e2e8-4b22-839f-791782112db0.png","open":true,"phonePrefix":39,"top":false},{"aliasName":"UAE 01- Abu Dhabi","alphaThree":"ARE","alphaTwo":"AE","countryName":"UAE 01- Abu Dhabi","enName":"UAE 01- Abu Dhabi","id":"1231833232115249154","nationalFlag":"https://dev.file.momooline.com/other/manager-41ffec46-d569-4235-89c8-a42f928b3f71.png","open":true,"phonePrefix":971,"top":false},{"aliasName":"Kuwait","alphaThree":"KWT","alphaTwo":"KW","countryName":"Kuwait","enName":"Kuwait","id":"1231833316571754497","nationalFlag":"https://dev.file.momooline.com/other/manager-9d7c61a8-c0a4-4923-9688-1f3eb65e1083.png","open":true,"phonePrefix":965,"top":false},{"aliasName":"Sri Lanka","alphaThree":"LKA","alphaTwo":"LK","countryName":"Sri Lanka","enName":"Sri Lanka","id":"1231833320958996482","nationalFlag":"https://dev.file.momooline.com/other/manager-369085b4-d012-4d49-b2df-85948ddd73d2.png","open":true,"phonePrefix":94,"top":false}]
/// tops : [{"aliasName":"KSA 02- Jeddah","alphaThree":"SAU","alphaTwo":"SP","countryName":"KSA 02- Jeddah","enName":"KSA 02- Jeddah","id":"1231833361190760450","nationalFlag":"https://dev.file.momooline.com/other/manager-5b5277f2-6ea7-4d2c-aa27-1435a6793905.png","open":true,"phonePrefix":966,"top":true},{"aliasName":"KSA 01- Abu Dhabi","alphaThree":"SAU","alphaTwo":"SA","countryName":"KSA 01- Abu Dhabi","enName":"KSA 01- Abu Dhabi","id":"1231833361190760449","nationalFlag":"https://dev.file.momooline.com/other/manager-5b5277f2-6ea7-4d2c-aa27-1435a6793905.png","open":true,"phonePrefix":966,"top":true},{"aliasName":"Egypt 02- Alexandria","alphaThree":"EGY","alphaTwo":"EY","countryName":"Egypt 02- Alexandria","enName":"Egypt 02- Alexandria","id":"1231833276281270275","nationalFlag":"https://dev.file.momooline.com/other/manager-2a1785b7-dd47-40ec-a1d9-18a505563dfe.png","open":true,"phonePrefix":20,"top":true},{"aliasName":"Egypt","alphaThree":"EGY","alphaTwo":"EG","countryName":"Egypt","enName":"Egypt","id":"1231833276281270274","nationalFlag":"https://dev.file.momooline.com/other/manager-2a1785b7-dd47-40ec-a1d9-18a505563dfe.png","open":true,"phonePrefix":20,"top":true}]
class CountryRes {
CountryRes({
List<Country>? openCountry,
List<Country>? tops,}){
_openCountry = openCountry;
_tops = tops;
}
CountryRes.fromJson(dynamic json) {
if (json['openCountry'] != null) {
_openCountry = [];
json['openCountry'].forEach((v) {
_openCountry?.add(Country.fromJson(v));
});
}
if (json['tops'] != null) {
_tops = [];
json['tops'].forEach((v) {
_tops?.add(Country.fromJson(v));
});
}
}
List<Country>? _openCountry;
List<Country>? _tops;
CountryRes copyWith({ List<Country>? openCountry,
List<Country>? tops,
}) => CountryRes( openCountry: openCountry ?? _openCountry,
tops: tops ?? _tops,
);
List<Country>? get openCountry => _openCountry;
List<Country>? get tops => _tops;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (_openCountry != null) {
map['openCountry'] = _openCountry?.map((v) => v.toJson()).toList();
}
if (_tops != null) {
map['tops'] = _tops?.map((v) => v.toJson()).toList();
}
return map;
}
}
/// aliasName : "KSA 02- Jeddah"
/// alphaThree : "SAU"
/// alphaTwo : "SP"
/// countryName : "KSA 02- Jeddah"
/// enName : "KSA 02- Jeddah"
/// id : "1231833361190760450"
/// nationalFlag : "https://dev.file.momooline.com/other/manager-5b5277f2-6ea7-4d2c-aa27-1435a6793905.png"
/// open : true
/// phonePrefix : 966
/// top : true
class Country {
Country({
String? aliasName,
String? alphaThree,
String? alphaTwo,
String? countryName,
String? enName,
String? id,
String? nationalFlag,
bool? open,
num? phonePrefix,
bool isSelect = false,
bool? top,}){
_aliasName = aliasName;
_alphaThree = alphaThree;
_alphaTwo = alphaTwo;
_countryName = countryName;
_enName = enName;
_id = id;
_nationalFlag = nationalFlag;
_open = open;
_phonePrefix = phonePrefix;
_top = top;
_isSelect = isSelect;
}
Country.fromJson(dynamic json) {
_aliasName = json['aliasName'];
_alphaThree = json['alphaThree'];
_alphaTwo = json['alphaTwo'];
_countryName = json['countryName'];
_enName = json['enName'];
_id = json['id'];
_nationalFlag = json['nationalFlag'];
_open = json['open'];
_phonePrefix = json['phonePrefix'];
_top = json['top'];
}
String? _aliasName;
String? _alphaThree;
String? _alphaTwo;
String? _countryName;
String? _enName;
String? _id;
String? _nationalFlag;
bool? _open;
num? _phonePrefix;
bool? _top;
bool _isSelect = false;
Country copyWith({ String? aliasName,
String? alphaThree,
String? alphaTwo,
String? countryName,
String? enName,
String? id,
String? nationalFlag,
bool? open,
num? phonePrefix,
bool? top,
}) => Country( aliasName: aliasName ?? _aliasName,
alphaThree: alphaThree ?? _alphaThree,
alphaTwo: alphaTwo ?? _alphaTwo,
countryName: countryName ?? _countryName,
enName: enName ?? _enName,
id: id ?? _id,
nationalFlag: nationalFlag ?? _nationalFlag,
open: open ?? _open,
phonePrefix: phonePrefix ?? _phonePrefix,
top: top ?? _top,
);
String? get aliasName => _aliasName;
String? get alphaThree => _alphaThree;
String? get alphaTwo => _alphaTwo;
String? get countryName => _countryName;
String? get enName => _enName;
String? get id => _id;
String? get nationalFlag => _nationalFlag;
bool? get open => _open;
num? get phonePrefix => _phonePrefix;
bool? get top => _top;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['aliasName'] = _aliasName;
map['alphaThree'] = _alphaThree;
map['alphaTwo'] = _alphaTwo;
map['countryName'] = _countryName;
map['enName'] = _enName;
map['id'] = _id;
map['nationalFlag'] = _nationalFlag;
map['open'] = _open;
map['phonePrefix'] = _phonePrefix;
map['top'] = _top;
return map;
}
}