Manage Beneficiary

This commit is contained in:
2025-08-08 15:43:08 +05:30
parent 117e2d5786
commit 763c101f58
6 changed files with 83 additions and 21 deletions

View File

@@ -1,26 +1,35 @@
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<String, dynamic> 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<String, dynamic> toJson() {
return {
'accountNo': accountNo,
@@ -30,6 +39,12 @@ class Beneficiary {
};
}
static List<Beneficiary> listFromJson(List<dynamic> 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)';