You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

70 lines
2.4 KiB

class TesoShop {
String shopID;
String shopName;
String shopTin;
String shopAddress;
double latitude;
double longitude;
String shopPhone;
DateTime dateEst;
String handle;
String categoryShop;
String shopDescription;
String logo;
String email;
TesoShop(
{this.shopID,
this.logo,
this.shopName,
this.shopAddress,
this.latitude,
this.longitude,
this.shopPhone,
this.dateEst,
this.handle,
this.categoryShop,
this.shopDescription,
this.email,
this.shopTin});
TesoShop.fromJSON(Map<String, dynamic> json)
: shopID = json["businessId"].toString(),
shopName = json["businessName"].toString(),
shopAddress = json["businessAddress"].toString(),
latitude = double.tryParse((json["businessLat"]).toString()),
longitude = double.tryParse((json["businessLng"]).toString()),
shopPhone = json["businessContact"].toString(),
dateEst = DateTime.tryParse((json['dateOfEst']).toString()),
handle = json['handle'].toString(),
categoryShop = json['businessCategory'].toString(),
shopDescription = json['businessDescription'].toString(),
logo = json['businessLogo'].toString(),
email = json['businessEmail'].toString(),
shopTin = json["businessTin"].toString();
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = Map<String, dynamic>();
data['businessId'] = this.shopID;
data['businessName'] = this.shopName;
data['businessLng'] = this.longitude;
data['businessLat'] = this.latitude;
data['businessAddress'] = this.shopAddress;
data['businessContact'] = this.shopPhone;
data['businessEmail'] = this.email;
data['dateOfEst'] = this.dateEst;
data['businessCategory'] = this.categoryShop;
data['businessTin'] = this.shopTin;
data['businessDescription'] = this.shopDescription;
data['businessLogo'] = this.logo;
data['handle'] = this.handle;
return data;
}
@override
String toString() {
return '{"businessId":"$shopID","businessName": "$shopName", "businessLat": "$latitude","businessLng":"$longitude","businessAddress": "$shopAddress",' +
'"businessContact":"$shopPhone","handle":"$handle","dateOfEst":"$dateEst","businessTin":"$shopTin","businessCategory:"$categoryShop",' +
'"businessDescription":"$shopDescription","businessLogo":"$logo","businessEmail":"$email"}';
}
}