Add forgot password, reset password, and verify OTP providers and view models
- Implemented `ForgotPasswordViewModel`, `ResetPasswordViewModel`, and `VerifyOtpViewModel` for handling respective functionalities. - Created provider functions for lazy loading of these view models in the app. - Updated routing to utilize the new providers for managing state in the forgot password flow. - Refactored UI components to integrate with the new view models, ensuring proper state management and user feedback during operations.
This commit is contained in:
@@ -9,6 +9,7 @@ import '../../../core/constants/common_strings.dart';
|
||||
import '../../../core/theme/colors.dart';
|
||||
import '../../../core/utils/app_toast.dart';
|
||||
import '../../../core/utils/size_config.dart';
|
||||
import '../../../view_models/auth_view_model.dart';
|
||||
import '../../shared/desktop_navigation_widget.dart';
|
||||
import '../strings/profile_strings.dart';
|
||||
import '../widgets/theme_toggle.dart';
|
||||
@@ -35,6 +36,7 @@ class _DesktopProfilePageState extends State<DesktopProfilePage> {
|
||||
AppToast.error(context, viewModel.errorMessage!);
|
||||
}
|
||||
if (viewModel.loggedOut) {
|
||||
context.read<AuthViewModel>().clearAuthFlow();
|
||||
Router.neglect(context, () => const LoginScreenRoute().go(context));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user