class Beneficiary { final String accountNo; final String accountType; final String name; final String ifscCode; final String? bankName; final String? branchName; Beneficiary({ required this.accountNo, required this.accountType, required this.name, required this.ifscCode, this.bankName, this.branchName, }); factory Beneficiary.fromJson(Map json) { print('=============================='); print(json); return Beneficiary( accountNo: json['accountNo'] ?? '', accountType: json['accountType'] ?? '', name: json['name'] ?? '', ifscCode: json['ifscCode'] ?? '', bankName: json['bankName'] ?? '', branchName: json['branchName'] ?? '', ); } Map toJson() { return { 'accountNo': accountNo, 'accountType': accountType, 'name': name, 'ifscCode' : ifscCode, }; } static List listFromJson(List jsonList) { final beneficiaryList = jsonList.map((beneficiary) => Beneficiary.fromJson(beneficiary)).toList(); print(beneficiaryList); return beneficiaryList; } @override String toString() { return 'Beneficiary(accountNo: $accountNo, accountType: $accountType, ifscCode: $ifscCode, name: $name)'; } }