dart format
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user