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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user