class Payload { String loadID; String load1; String load2; String load3; String load4; String load5; String load6; String load7; String load8; String load9; String load10; Payload({ this.load1, this.load2, this.load3, this.load4, this.load5, this.load6, this.load7, this.load8, this.load9, this.load10, this.loadID, }); factory Payload.fromJSON(Map json) { return Payload( load1: json['load1'].toString(), load2: json['load2'].toString(), load3: json['load3'].toString(), load4: json['load4'].toString(), load5: json['load5'].toString(), load6: json['load6'].toString(), load7: json['load7'].toString(), load8: json['load8'].toString(), load9: json['load9'].toString(), load10: json['load10'].toString(), loadID: json['loadID'], ); } Map toJson() { final Map data = Map(); data['load1'] = this.load1; data['load2'] = this.load2; data['load3'] = this.load3; data['load4'] = this.load4; data['load5'] = this.load5; data['load6'] = this.load6; data['load7'] = this.load7; data['load8'] = this.load8; data['load9'] = this.load9; data['load10'] = this.load10; data['loadID'] = this.loadID; return data; } @override String toString() { return '{"load1": "$load1","load2": "$load2","load3": "$load3","load4": "$load4","load5": "$load5","load6": "$load6","load7": "$load7","load8": "$load8","load9": "$load9","load10": "$load10","loadID": "$loadID"}'; } }