- 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)
37 lines
706 B
Dart
37 lines
706 B
Dart
class UserEntity {
|
|
final String id;
|
|
final String email;
|
|
final String name;
|
|
final DateTime? createdAt;
|
|
|
|
const UserEntity({
|
|
required this.id,
|
|
required this.email,
|
|
required this.name,
|
|
this.createdAt,
|
|
});
|
|
|
|
UserEntity copyWith({
|
|
String? id,
|
|
String? email,
|
|
String? name,
|
|
DateTime? createdAt,
|
|
}) {
|
|
return UserEntity(
|
|
id: id ?? this.id,
|
|
email: email ?? this.email,
|
|
name: name ?? this.name,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
if (identical(this, other)) return true;
|
|
return other is UserEntity && other.id == id;
|
|
}
|
|
|
|
@override
|
|
int get hashCode => id.hashCode;
|
|
}
|