PaymentsRes.fromJson constructor
fromJson is a factory method that creates a new instance of the PaymentsRes class from a map of dynamic objects.
Implementation
factory PaymentsRes.fromJson(Map<String, dynamic> json) {
return PaymentsRes(
payments: json['payments'] != null
? List<PaymentModel>.from(
json['payments'].map((x) => PaymentModel.fromJson(x)))
: [],
);
}