59 lines
1.3 KiB
Dart
59 lines
1.3 KiB
Dart
import 'package:equatable/equatable.dart';
|
|
import 'package:kmobile/data/models/user.dart';
|
|
import 'package:kmobile/features/auth/models/auth_token.dart';
|
|
|
|
abstract class AuthState extends Equatable {
|
|
const AuthState();
|
|
|
|
@override
|
|
List<Object> get props => [];
|
|
}
|
|
|
|
class AuthInitial extends AuthState {}
|
|
|
|
class AuthLoading extends AuthState {}
|
|
|
|
class Authenticated extends AuthState {
|
|
final List<User> users;
|
|
const Authenticated(this.users);
|
|
|
|
@override
|
|
List<Object> get props => [users];
|
|
}
|
|
|
|
class Unauthenticated extends AuthState {}
|
|
|
|
class AuthError extends AuthState {
|
|
final String message;
|
|
const AuthError(this.message);
|
|
|
|
@override
|
|
List<Object> get props => [message];
|
|
}
|
|
|
|
// --- New States for Navigation and Dialog ---
|
|
|
|
// State to indicate that the TNC dialog needs to be shown
|
|
class ShowTncDialog extends AuthState {
|
|
final AuthToken authToken;
|
|
final List<User> users;
|
|
const ShowTncDialog(this.authToken, this.users);
|
|
|
|
@override
|
|
List<Object> get props => [authToken, users];
|
|
}
|
|
|
|
// States to trigger specific navigations from the UI
|
|
class NavigateToTncRequiredScreen extends AuthState {}
|
|
|
|
class NavigateToMpinSetupScreen extends AuthState {
|
|
final List<User> users;
|
|
|
|
const NavigateToMpinSetupScreen(this.users);
|
|
|
|
@override
|
|
List<Object> get props => [users];
|
|
}
|
|
|
|
class NavigateToDashboardScreen extends AuthState {}
|