dart format

This commit is contained in:
2025-11-10 16:50:29 +05:30
parent d6f61ebb31
commit 8cfca113bf
28 changed files with 1995 additions and 1973 deletions

View File

@@ -25,7 +25,9 @@ class Beneficiary {
return Beneficiary(
accountNo: json['account_no'] ?? json['accountNo'] ?? '',
accountType: json['account_type'] ?? json['accountType'] ?? '',
createdAt: json['createdAt'] == null ? null : DateTime.tryParse(json['createdAt']),
createdAt: json['createdAt'] == null
? null
: DateTime.tryParse(json['createdAt']),
name: json['name'] ?? '',
ifscCode: json['ifsc_code'] ?? json['ifscCode'] ?? '',
bankName: json['bank_name'] ?? json['bankName'] ?? '',

View File

@@ -17,7 +17,8 @@ class AuthRepository {
AuthRepository(this._authService, this._userService, this._secureStorage);
Future<(List<User>, AuthToken)> login(String customerNo, String password) async {
Future<(List<User>, AuthToken)> login(
String customerNo, String password) async {
// Create credentials and call service
final credentials =
AuthCredentials(customerNo: customerNo, password: password);
@@ -64,21 +65,22 @@ class AuthRepository {
final authToken = AuthToken(
accessToken: accessToken,
expiresAt: DateTime.parse(expiryString),
tnc: tncString == 'true', // Parse 'true' string to true, otherwise false
tnc:
tncString == 'true', // Parse 'true' string to true, otherwise false
);
return authToken;
}
return null;
}
Future<void> acceptTnc() async {
// This method calls the setTncFlag function
try {
await _authService.setTncflag();
} catch (e) {
// Handle or rethrow the error as needed
print('Error setting TNC flag: $e');
rethrow;
}
}
Future<void> acceptTnc() async {
// This method calls the setTncFlag function
try {
await _authService.setTncflag();
} catch (e) {
// Handle or rethrow the error as needed
print('Error setting TNC flag: $e');
rethrow;
}
}
}