class SilverPurchaseRequest { int? coinamount; String? method; double? amount; SilverPurchaseRequest({ this.coinamount, this.method, this.amount, }); factory SilverPurchaseRequest.fromJSON(Map json) { return SilverPurchaseRequest( coinamount: json["coinamount"], method: json["method"], amount: json["amount"], ); } Map toJson() { final Map data = Map(); try { data['coinamount'] = this.coinamount; data['method'] = this.method; data['amount'] = this.amount; } catch (e) { print(e); } return data; } @override String toString() { return '{"coinamount": "$coinamount", "costamount": "$amount", "method": "$method"}'; } }