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
+17 -4
View File
@@ -415,10 +415,15 @@ RouteBase get $forgotPasswordOtpRouteData => GoRouteData.$route(
mixin _$ForgotPasswordOtpRouteData on GoRouteData {
static ForgotPasswordOtpRouteData _fromState(GoRouterState state) =>
const ForgotPasswordOtpRouteData();
ForgotPasswordOtpRouteData(email: state.uri.queryParameters['email']!);
ForgotPasswordOtpRouteData get _self => this as ForgotPasswordOtpRouteData;
@override
String get location => GoRouteData.$location('/forgot-password-otp');
String get location => GoRouteData.$location(
'/forgot-password-otp',
queryParams: {'email': _self.email},
);
@override
void go(BuildContext context) => context.go(location);
@@ -442,10 +447,18 @@ RouteBase get $forgotPasswordCreateRouteData => GoRouteData.$route(
mixin _$ForgotPasswordCreateRouteData on GoRouteData {
static ForgotPasswordCreateRouteData _fromState(GoRouterState state) =>
const ForgotPasswordCreateRouteData();
ForgotPasswordCreateRouteData(
resetToken: state.uri.queryParameters['reset-token']!,
);
ForgotPasswordCreateRouteData get _self =>
this as ForgotPasswordCreateRouteData;
@override
String get location => GoRouteData.$location('/forgot-password-create');
String get location => GoRouteData.$location(
'/forgot-password-create',
queryParams: {'reset-token': _self.resetToken},
);
@override
void go(BuildContext context) => context.go(location);