added splash screen

This commit is contained in:
amirrezaghabeli
2025-09-22 16:04:49 +03:30
parent 197ad18618
commit f1214d8a28
14 changed files with 253 additions and 12 deletions
+17
View File
@@ -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;