|
|
|
|
@ -54,19 +54,15 @@ class _ResetPasswordViewState extends State<ResetPasswordView> {
|
|
|
|
|
validator: (value) => Validator.hasValue(value) ? null : context.translation.requiredField,
|
|
|
|
|
labelText: context.translation.password,
|
|
|
|
|
obscureText: !_passwordVisible,
|
|
|
|
|
suffixIcon: IconButton(
|
|
|
|
|
icon: Icon(
|
|
|
|
|
// Based on passwordVisible state choose the icon
|
|
|
|
|
_passwordVisible ? Icons.visibility : Icons.visibility_off,
|
|
|
|
|
color: context.isDark ? AppColor.neutral10 : AppColor.neutral20,
|
|
|
|
|
),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
// Update the state i.e. toogle the state of passwordVisible variable
|
|
|
|
|
setState(() {
|
|
|
|
|
_passwordVisible = !_passwordVisible;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
suffixIcon: Icon(
|
|
|
|
|
// Based on passwordVisible state choose the icon
|
|
|
|
|
_passwordVisible ? Icons.visibility : Icons.visibility_off,
|
|
|
|
|
color: context.isDark ? AppColor.neutral10 : AppColor.neutral20,
|
|
|
|
|
).paddingOnly(end: 12).onPress(() {
|
|
|
|
|
setState(() {
|
|
|
|
|
_passwordVisible = !_passwordVisible;
|
|
|
|
|
});
|
|
|
|
|
}),
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
_userProvider.newPassword = value;
|
|
|
|
|
},
|
|
|
|
|
@ -85,19 +81,12 @@ class _ResetPasswordViewState extends State<ResetPasswordView> {
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
_userProvider.confirmPassword = value;
|
|
|
|
|
},
|
|
|
|
|
suffixIcon: IconButton(
|
|
|
|
|
icon: Icon(
|
|
|
|
|
// Based on passwordVisible state choose the icon
|
|
|
|
|
_confirmPasswordVisible ? Icons.visibility : Icons.visibility_off,
|
|
|
|
|
color: context.isDark ? AppColor.neutral10 : AppColor.neutral20,
|
|
|
|
|
),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
// Update the state i.e. toogle the state of passwordVisible variable
|
|
|
|
|
setState(() {
|
|
|
|
|
_confirmPasswordVisible = !_confirmPasswordVisible;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
suffixIcon: Icon(
|
|
|
|
|
_confirmPasswordVisible ? Icons.visibility : Icons.visibility_off,
|
|
|
|
|
color: context.isDark ? AppColor.neutral10 : AppColor.neutral20,
|
|
|
|
|
).paddingOnly(end: 12).onPress(() { setState(() {
|
|
|
|
|
_confirmPasswordVisible = !_confirmPasswordVisible;
|
|
|
|
|
}); }),
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
|
@ -126,16 +115,5 @@ class _ResetPasswordViewState extends State<ResetPasswordView> {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// if (status >= 200 && status < 300 && _userProvider.user.isAuthenticated ?? false) {
|
|
|
|
|
// await _settingProvider.setUser(_userProvider.user);
|
|
|
|
|
// (await SharedPreferences.getInstance()).remove(ASettings.localAuth);
|
|
|
|
|
// await _settingProvider.setRememberMe(_user.userName, _user.password, rememberMe);
|
|
|
|
|
//
|
|
|
|
|
// /// The below line for the new design
|
|
|
|
|
// // Navigator.pushNamed(context, LandPage.routeName);
|
|
|
|
|
// Navigator.pushNamed(context, LandPage.routeName);
|
|
|
|
|
// } else {
|
|
|
|
|
// Fluttertoast.showToast(msg: _userProvider.user?.message ?? context.translation.failedToCompleteRequest);
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|