mirror of
https://github.com/flutter/samples.git
synced 2025-11-14 11:28:36 +00:00
Flutter 3.29 beta (#2571)
This commit is contained in:
@@ -12,10 +12,7 @@ abstract class AuthRepository extends ChangeNotifier {
|
||||
Future<bool> get isAuthenticated;
|
||||
|
||||
/// Perform login
|
||||
Future<Result<void>> login({
|
||||
required String email,
|
||||
required String password,
|
||||
});
|
||||
Future<Result<void>> login({required String email, required String password});
|
||||
|
||||
/// Perform logout
|
||||
Future<Result<void>> logout();
|
||||
|
||||
@@ -17,9 +17,9 @@ class AuthRepositoryRemote extends AuthRepository {
|
||||
required ApiClient apiClient,
|
||||
required AuthApiClient authApiClient,
|
||||
required SharedPreferencesService sharedPreferencesService,
|
||||
}) : _apiClient = apiClient,
|
||||
_authApiClient = authApiClient,
|
||||
_sharedPreferencesService = sharedPreferencesService {
|
||||
}) : _apiClient = apiClient,
|
||||
_authApiClient = authApiClient,
|
||||
_sharedPreferencesService = sharedPreferencesService {
|
||||
_apiClient.authHeaderProvider = _authHeaderProvider;
|
||||
}
|
||||
|
||||
@@ -64,10 +64,7 @@ class AuthRepositoryRemote extends AuthRepository {
|
||||
}) async {
|
||||
try {
|
||||
final result = await _authApiClient.login(
|
||||
LoginRequest(
|
||||
email: email,
|
||||
password: password,
|
||||
),
|
||||
LoginRequest(email: email, password: password),
|
||||
);
|
||||
switch (result) {
|
||||
case Ok<LoginResponse>():
|
||||
|
||||
Reference in New Issue
Block a user