Manage Beneficiary
This commit is contained in:
@@ -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)';
|
||||
|
45
lib/data/models/beneficiary_recieve.dart
Normal file
45
lib/data/models/beneficiary_recieve.dart
Normal file
@@ -0,0 +1,45 @@
|
||||
class BeneficiaryRecieve {
|
||||
final String accountNo;
|
||||
final String accountType;
|
||||
final String name;
|
||||
final String ifscCode;
|
||||
final String bankName;
|
||||
final String branchName;
|
||||
|
||||
|
||||
BeneficiaryRecieve({
|
||||
required this.accountNo,
|
||||
required this.accountType,
|
||||
required this.name,
|
||||
required this.ifscCode,
|
||||
required this.bankName,
|
||||
required this.branchName,
|
||||
});
|
||||
|
||||
factory BeneficiaryRecieve.fromJson(Map<String, dynamic> json) {
|
||||
return BeneficiaryRecieve(
|
||||
accountNo: json['account_no'] ?? '',
|
||||
accountType: json['account_type'] ?? '',
|
||||
name: json['name'] ?? '',
|
||||
ifscCode: json['ifsc_code'] ?? '',
|
||||
bankName: json['bank_name'] ?? '',
|
||||
branchName: json['branch_name'] ?? '',
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'account_no': accountNo,
|
||||
'account_type': accountType,
|
||||
'name': name,
|
||||
'ifsc_code' : ifscCode,
|
||||
'bank_name' : bankName,
|
||||
'branch_name' : branchName
|
||||
};
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ListBeneficiary(accountNo: $accountNo, accountType: $accountType, ifscCode: $ifscCode, name: $name, bankName: $bankName, branchName: $branchName)';
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user