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:
amirrezaghabeli
2025-10-06 15:39:08 +03:30
parent b522bc77a9
commit cee5e6c6d6
23 changed files with 490 additions and 310 deletions
@@ -9,6 +9,7 @@ import 'package:tm_app/view_models/profile_view_model.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/tablet_navigation_widget.dart';
import '../../shared/tender_app_bar.dart';
import '../strings/profile_strings.dart';
@@ -36,6 +37,7 @@ class _TabletProfilePageState extends State<TabletProfilePage> {
AppToast.error(context, viewModel.errorMessage!);
}
if (viewModel.loggedOut) {
context.read<AuthViewModel>().clearAuthFlow();
Router.neglect(context, () => const LoginScreenRoute().go(context));
}
}