added splash screen
This commit is contained in:
@@ -44,6 +44,7 @@ class AuthViewModel with ChangeNotifier {
|
||||
|
||||
// Auth state
|
||||
bool _isLoading = false;
|
||||
bool _isLoggedIn = false;
|
||||
bool _isResetPasswordLoading = false;
|
||||
String? _errorMessage;
|
||||
String? _resetPasswordErrorMessage;
|
||||
@@ -59,6 +60,7 @@ class AuthViewModel with ChangeNotifier {
|
||||
bool _verifyOtpSuccess = false;
|
||||
|
||||
bool get isLoading => _isLoading;
|
||||
bool get isLoggedIn => _isLoggedIn;
|
||||
bool get isLoadingForgot => _isLoadingForgot;
|
||||
bool get isLoadingOtp => _isLoadingOtp;
|
||||
bool get isResetPasswordLoading => _isResetPasswordLoading;
|
||||
@@ -282,6 +284,21 @@ class AuthViewModel with ChangeNotifier {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> checkIsLoggedIn() async {
|
||||
final result = await _authRepository.checkIsLoggedIn();
|
||||
|
||||
if (result is Ok<bool>) {
|
||||
if (result.value) {
|
||||
_isLoggedIn = result.value;
|
||||
} else {
|
||||
_isLoggedIn = false;
|
||||
}
|
||||
} else {
|
||||
_isLoggedIn = false;
|
||||
}
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void clearResetPasswordSuccess() {
|
||||
_resetPasswordSuccess = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user