- Create auth feature with Clean Architecture (domain/data/presentation) - Add login and register pages with form validation - Implement secure token storage with flutter_secure_storage - Create AuthenticatedClient for automatic Bearer token headers - Add AuthViewModel for global auth state management - Update router with auth guards (redirect to login if not authenticated) - Add logout option to settings page - Update TaskRemoteDataSource to use authenticated client - Add auth-related localization strings (EN/DE)
26 lines
545 B
Dart
26 lines
545 B
Dart
import '../../../../core/errors/result.dart';
|
|
import '../entities/user_entity.dart';
|
|
|
|
abstract class AuthRepository {
|
|
Future<Result<UserEntity>> register({
|
|
required String email,
|
|
required String password,
|
|
required String name,
|
|
});
|
|
|
|
Future<Result<UserEntity>> login({
|
|
required String email,
|
|
required String password,
|
|
});
|
|
|
|
Future<Result<void>> logout();
|
|
|
|
Future<Result<UserEntity>> getCurrentUser();
|
|
|
|
Future<Result<void>> refreshToken();
|
|
|
|
Future<bool> isAuthenticated();
|
|
|
|
Stream<bool> get authStateChanges;
|
|
}
|