import 'dart:convert'; class PaymentMethodResponseModel { final String? status; final PaymentMethodData? data; PaymentMethodResponseModel({ this.status, this.data, }); factory PaymentMethodResponseModel.fromJson(String str) => PaymentMethodResponseModel.fromMap(json.decode(str)); String toJson() => json.encode(toMap()); factory PaymentMethodResponseModel.fromMap(Map json) => PaymentMethodResponseModel( status: json["status"], data: json["data"] == null ? null : PaymentMethodData.fromMap(json["data"]), ); Map toMap() => { "status": status, "data": data?.toMap(), }; } class PaymentMethodData { final String? total; final List? paymentMethods; PaymentMethodData({ this.total, this.paymentMethods, }); factory PaymentMethodData.fromJson(String str) => PaymentMethodData.fromMap(json.decode(str)); String toJson() => json.encode(toMap()); factory PaymentMethodData.fromMap(Map json) => PaymentMethodData( total: json["total"], paymentMethods: json["payment_methods"] == null ? [] : List.from( json["payment_methods"]!.map((x) => PaymentMethodItem.fromMap(x))), ); Map toMap() => { "total": total, "payment_methods": paymentMethods == null ? [] : List.from(paymentMethods!.map((x) => x.toMap())), }; } class PaymentMethodItem { final String? paymentMethod; final String? totalAmount; final int? transactionCount; PaymentMethodItem({ this.paymentMethod, this.totalAmount, this.transactionCount, }); factory PaymentMethodItem.fromJson(String str) => PaymentMethodItem.fromMap(json.decode(str)); String toJson() => json.encode(toMap()); factory PaymentMethodItem.fromMap(Map json) => PaymentMethodItem( paymentMethod: json["payment_method"], totalAmount: json["total_amount"], transactionCount: json["transaction_count"], ); Map toMap() => { "payment_method": paymentMethod, "total_amount": totalAmount, "transaction_count": transactionCount, }; }