|
|
|
|
@ -4,8 +4,6 @@ import 'package:tangheem/api/user_api_client.dart';
|
|
|
|
|
import 'package:tangheem/classes/colors.dart';
|
|
|
|
|
import 'package:tangheem/classes/utils.dart';
|
|
|
|
|
import 'package:tangheem/extensions/string_extensions.dart';
|
|
|
|
|
import 'package:tangheem/ui/dialogs/change_password_dialog.dart';
|
|
|
|
|
import 'package:tangheem/ui/dialogs/otp_dialog.dart';
|
|
|
|
|
import 'package:tangheem/widgets/common_textfield_widget.dart';
|
|
|
|
|
|
|
|
|
|
class ForgotPasswordScreen extends StatefulWidget {
|
|
|
|
|
@ -36,7 +34,7 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> {
|
|
|
|
|
Utils.showLoading(context);
|
|
|
|
|
try {
|
|
|
|
|
await UserApiClient().forgotPassword(email);
|
|
|
|
|
Utils.showToast("تم إرسال الرابط إلى عنوان بريدك الإلكتروني ، يرجى تعيين كلمة مرور جديدة بالنقر فوق هذا الرابط .");
|
|
|
|
|
Utils.showToast("تم إرسال رابط تغيير كلمة المرور إلى بريدك الإلكتروني");
|
|
|
|
|
} catch (ex) {
|
|
|
|
|
Utils.handleException(ex, null);
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
@ -152,23 +150,23 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// void getOTP(String email) {
|
|
|
|
|
// showDialog(
|
|
|
|
|
// context: context,
|
|
|
|
|
// barrierColor: ColorConsts.secondaryWhite.withOpacity(0.8),
|
|
|
|
|
// builder: (BuildContext context) => OTPDialog(
|
|
|
|
|
// onOTP: (otp) => verifyOTP(email, otp),
|
|
|
|
|
// ),
|
|
|
|
|
// );
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// void changePassword(String email, int otp) {
|
|
|
|
|
// showDialog(
|
|
|
|
|
// context: context,
|
|
|
|
|
// barrierColor: ColorConsts.secondaryWhite.withOpacity(0.8),
|
|
|
|
|
// builder: (BuildContext context) => ChangePasswordDialog(
|
|
|
|
|
// onPassword: (password) => updatePassword(email, otp, password),
|
|
|
|
|
// ),
|
|
|
|
|
// );
|
|
|
|
|
// }
|
|
|
|
|
// void getOTP(String email) {
|
|
|
|
|
// showDialog(
|
|
|
|
|
// context: context,
|
|
|
|
|
// barrierColor: ColorConsts.secondaryWhite.withOpacity(0.8),
|
|
|
|
|
// builder: (BuildContext context) => OTPDialog(
|
|
|
|
|
// onOTP: (otp) => verifyOTP(email, otp),
|
|
|
|
|
// ),
|
|
|
|
|
// );
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// void changePassword(String email, int otp) {
|
|
|
|
|
// showDialog(
|
|
|
|
|
// context: context,
|
|
|
|
|
// barrierColor: ColorConsts.secondaryWhite.withOpacity(0.8),
|
|
|
|
|
// builder: (BuildContext context) => ChangePasswordDialog(
|
|
|
|
|
// onPassword: (password) => updatePassword(email, otp, password),
|
|
|
|
|
// ),
|
|
|
|
|
// );
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|