class Product { String itemID; String name; String shopName; String shopLocation; String country; String duration; String adShort; String adFull; Product( {this.itemID, this.name, this.shopName, this.shopLocation, this.country, this.duration, this.adShort, this.adFull}); Product.fromJSON(Map json) : itemID = json['productID'], name = json['name'], shopName = json['shopName'], shopLocation = json['shopLocation'], duration = json['duration'], adShort = json['adShort'], adFull = json['adFull'], country = json['country']; Map toJson() { final Map data = Map(); data['itemID'] = this.itemID; data['name'] = this.name; data['shopName'] = this.shopName; data['shopLocation'] = this.shopLocation; data['country'] = this.country; data['duration'] = this.duration; data['adShort'] = this.adShort; data['adFull'] = this.adFull; return data; } @override String toString() { return '{"itemID":"$itemID","name": "$name", "shopName": "$shopName","shopLocation": "$shopLocation","country":"$country","duration":"$duration","adFull":"$adFull","adShort":"$adShort"}'; } }