feat:resetting password done
This commit is contained in:
3
assets/icons/common/ic_clock.svg
Normal file
3
assets/icons/common/ic_clock.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg width="49" height="56" viewBox="0 0 49 56" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M39.3392 31.4713C40.2309 31.4713 41.0963 31.5762 41.9618 31.7074V23.6035C41.9618 22.2124 41.4092 20.8782 40.4255 19.8946C39.4418 18.9109 38.1077 18.3583 36.7166 18.3583H34.0939V13.1131C34.0939 5.87465 28.2193 0 20.9809 0C13.7425 0 7.86783 5.87465 7.86783 13.1131V18.3583H5.24522C3.8541 18.3583 2.51996 18.9109 1.53629 19.8946C0.55262 20.8782 0 22.2124 0 23.6035V49.8296C0 52.7407 2.33412 55.0748 5.24522 55.0748H25.7278C24.3903 52.7669 23.6035 50.0919 23.6035 47.207C23.6035 38.5262 30.6583 31.4713 39.3392 31.4713ZM13.1131 13.1131C13.1131 8.75952 16.6274 5.24522 20.9809 5.24522C25.3344 5.24522 28.8487 8.75952 28.8487 13.1131V18.3583H13.1131V13.1131ZM20.9809 41.9618C19.9435 41.9618 18.9294 41.6542 18.0668 41.0778C17.2042 40.5015 16.5319 39.6823 16.1349 38.7238C15.7379 37.7654 15.6341 36.7107 15.8365 35.6933C16.0388 34.6758 16.5384 33.7412 17.272 33.0076C18.0055 32.2741 18.9401 31.7745 19.9576 31.5721C20.9751 31.3697 22.0297 31.4736 22.9881 31.8706C23.9466 32.2676 24.7658 32.9399 25.3421 33.8025C25.9185 34.665 26.2261 35.6792 26.2261 36.7166C26.2261 39.6277 23.892 41.9618 20.9809 41.9618ZM48.5183 42.6174L36.0609 55.0748L28.8487 47.207L31.891 44.1648L36.0609 48.3347L45.4761 38.9196L48.5183 42.6174Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
@@ -21,7 +21,7 @@
|
||||
},
|
||||
"please_login": "Please login to your account",
|
||||
"email_or_phone": "Phone Number",
|
||||
"enter_email_or_phone": "Enter your email or phone number",
|
||||
"enter_email_or_phone": "Enter your phone number",
|
||||
"password": "Password",
|
||||
"enter_password": "Enter your password",
|
||||
"forgot_password": "Forgot Password?",
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
},
|
||||
"please_login": "Пожалуйста, войдите в свой аккаунт",
|
||||
"email_or_phone": "Номер телефона",
|
||||
"enter_email_or_phone": "Введите свою почту или номер телефона",
|
||||
"enter_email_or_phone": "Введите свою номер телефона",
|
||||
"password": "Пароль",
|
||||
"enter_password": "Введите свой пароль",
|
||||
"forgot_password": "Забыли пароль?",
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
},
|
||||
"please_login": "Iltimos, akkauntingizga kiring",
|
||||
"email_or_phone": "Telefon raqami",
|
||||
"enter_email_or_phone": "Email yoki telefon raqamingizni kiriting",
|
||||
"enter_email_or_phone": "Telefon raqamingizni kiriting",
|
||||
"password": "Parol",
|
||||
"enter_password": "Parolingizni kiriting",
|
||||
"forgot_password": "Parolni unutdingizmi?",
|
||||
|
||||
@@ -193,7 +193,7 @@ abstract class AppLocalizations {
|
||||
/// No description provided for @enter_email_or_phone.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Enter your email or phone number'**
|
||||
/// **'Enter your phone number'**
|
||||
String get enter_email_or_phone;
|
||||
|
||||
/// No description provided for @password.
|
||||
|
||||
@@ -62,7 +62,7 @@ class AppLocalizationsEn extends AppLocalizations {
|
||||
String get email_or_phone => 'Phone Number';
|
||||
|
||||
@override
|
||||
String get enter_email_or_phone => 'Enter your email or phone number';
|
||||
String get enter_email_or_phone => 'Enter your phone number';
|
||||
|
||||
@override
|
||||
String get password => 'Password';
|
||||
|
||||
@@ -60,7 +60,7 @@ class AppLocalizationsRu extends AppLocalizations {
|
||||
String get email_or_phone => 'Номер телефона';
|
||||
|
||||
@override
|
||||
String get enter_email_or_phone => 'Введите свою почту или номер телефона';
|
||||
String get enter_email_or_phone => 'Введите свою номер телефона';
|
||||
|
||||
@override
|
||||
String get password => 'Пароль';
|
||||
|
||||
@@ -60,7 +60,7 @@ class AppLocalizationsUz extends AppLocalizations {
|
||||
String get email_or_phone => 'Telefon raqami';
|
||||
|
||||
@override
|
||||
String get enter_email_or_phone => 'Email yoki telefon raqamingizni kiriting';
|
||||
String get enter_email_or_phone => 'Telefon raqamingizni kiriting';
|
||||
|
||||
@override
|
||||
String get password => 'Parol';
|
||||
|
||||
@@ -56,4 +56,7 @@ abstract class AppColors {
|
||||
static const Color c151B33 = Color(0xFF151B33);
|
||||
static const Color cE5E7EB = Color(0xFFE5E7EB);
|
||||
static const Color cE2E8F0 = Color(0xFFE2E8F0);
|
||||
static const Color cDFE2EB = Color(0xFFDFE2EB);
|
||||
static const Color c9FB6FA = Color(0xFF9FB6FA);
|
||||
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ abstract class AppIcons {
|
||||
static const String icCart1 = "$baseUrl/ic_cart1.svg";
|
||||
static const String icTransactions = "$baseUrl/ic_transactions.svg";
|
||||
static const String icProfile = "$baseUrl/ic_profile.svg";
|
||||
static const String icClock = "$baseUrl/ic_clock.svg";
|
||||
|
||||
}
|
||||
|
||||
abstract class AppLightSvgs {
|
||||
|
||||
@@ -10,6 +10,7 @@ class AppThemeColors extends ThemeExtension<AppThemeColors> {
|
||||
final Color inActiveColor;
|
||||
final Color inActiveColor1;
|
||||
final Color inActiveColor2;
|
||||
final Color rippleColor;
|
||||
|
||||
AppThemeColors({
|
||||
required this.onBoardingColor,
|
||||
@@ -20,6 +21,7 @@ class AppThemeColors extends ThemeExtension<AppThemeColors> {
|
||||
required this.inActiveColor,
|
||||
required this.inActiveColor1,
|
||||
required this.inActiveColor2,
|
||||
required this.rippleColor,
|
||||
});
|
||||
|
||||
static AppThemeColors light = AppThemeColors(
|
||||
@@ -31,6 +33,7 @@ class AppThemeColors extends ThemeExtension<AppThemeColors> {
|
||||
inActiveColor: AppColors.cE2E4EA,
|
||||
inActiveColor1: AppColors.cA9A9A9,
|
||||
inActiveColor2: AppColors.cE5E7EB,
|
||||
rippleColor: AppColors.c9FB6FA,
|
||||
);
|
||||
|
||||
static AppThemeColors dark = AppThemeColors(
|
||||
@@ -42,6 +45,7 @@ class AppThemeColors extends ThemeExtension<AppThemeColors> {
|
||||
inActiveColor: AppColors.c292F3D,
|
||||
inActiveColor1: AppColors.c626262,
|
||||
inActiveColor2: AppColors.c292F3D,
|
||||
rippleColor: AppColors.cFF6F00,
|
||||
);
|
||||
|
||||
@override
|
||||
@@ -54,6 +58,7 @@ class AppThemeColors extends ThemeExtension<AppThemeColors> {
|
||||
Color? inActiveColor,
|
||||
Color? inActiveColor1,
|
||||
Color? inActiveColor2,
|
||||
Color? rippleColor,
|
||||
}) {
|
||||
return AppThemeColors(
|
||||
onBoardingColor: onBoardingColor ?? this.onBoardingColor,
|
||||
@@ -64,6 +69,7 @@ class AppThemeColors extends ThemeExtension<AppThemeColors> {
|
||||
inActiveColor: inActiveColor ?? this.inActiveColor,
|
||||
inActiveColor1: inActiveColor1 ?? this.inActiveColor1,
|
||||
inActiveColor2: inActiveColor2 ?? this.inActiveColor2,
|
||||
rippleColor: rippleColor ?? this.rippleColor,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'package:food_delivery_client/feature/auth/presentation/pages/create_new_password_page/widgets/create_new_password_body.dart';
|
||||
|
||||
import '../../../../../food_delivery_client.dart';
|
||||
|
||||
class CreateNewPasswordPage extends StatelessWidget {
|
||||
@@ -7,6 +9,6 @@ class CreateNewPasswordPage extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return WLayout(child: Scaffold());
|
||||
return CreateNewPasswordBody(phoneNumber: phoneNumber );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
import '../../../../../../food_delivery_client.dart';
|
||||
|
||||
class ChangePasswordSuccessPassword extends StatelessWidget {
|
||||
const ChangePasswordSuccessPassword({super.key});
|
||||
|
||||
void show(BuildContext context) {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
backgroundColor: AppColors.cTransparent,
|
||||
enableDrag: false,
|
||||
isDismissible: false,
|
||||
useSafeArea: false,
|
||||
builder: (context) => Wrap(children: [this]),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SizedBox(
|
||||
width: context.w,
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: context.theme.scaffoldBackgroundColor,
|
||||
borderRadius: AppUtils.kBorderRadius30,
|
||||
),
|
||||
child: SafeArea(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
10.verticalSpace,
|
||||
SizedBox(
|
||||
height: 6,
|
||||
width: 60,
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.cDFE2EB,
|
||||
borderRadius: AppUtils.kBorderRadius10,
|
||||
),
|
||||
),
|
||||
),
|
||||
54.verticalSpace,
|
||||
SizedBox(
|
||||
height: 162,
|
||||
width: 162,
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(160),
|
||||
color: context.appThemeColors.rippleColor.newWithOpacity(
|
||||
.2,
|
||||
),
|
||||
),
|
||||
child: Center(
|
||||
child: SizedBox(
|
||||
height: 103.74,
|
||||
width: 103.74,
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.cFF6F00,
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
),
|
||||
child: Center(
|
||||
child: SvgPicture.asset(AppIcons.icClock),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
54.verticalSpace,
|
||||
Text(
|
||||
context.loc.changePasswordSuccess,
|
||||
style: context.appThemeTextStyles.size24Bold,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
14.verticalSpace,
|
||||
Text(
|
||||
context.loc.changePasswordMessage,
|
||||
style: context.appThemeTextStyles.size14Regular,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
65.verticalSpace,
|
||||
AppButton(
|
||||
name: context.loc.login,
|
||||
onPressed: () {
|
||||
context.go(Routes.login);
|
||||
},
|
||||
),
|
||||
15.verticalSpace,
|
||||
],
|
||||
).paddingSymmetric(horizontal: 24),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,126 @@
|
||||
import '../../../../../../food_delivery_client.dart';
|
||||
import 'package:food_delivery_client/core/helpers/validator_helpers.dart';
|
||||
import 'package:food_delivery_client/feature/common/presentation/widgets/app_text_form_field.dart';
|
||||
|
||||
class CreateNewPasswordBody extends StatelessWidget {
|
||||
const CreateNewPasswordBody({super.key});
|
||||
import '../../../../../../food_delivery_client.dart';
|
||||
import 'change_password_success.dart';
|
||||
|
||||
class CreateNewPasswordBody extends StatefulWidget {
|
||||
const CreateNewPasswordBody({super.key, required this.phoneNumber});
|
||||
|
||||
final String phoneNumber;
|
||||
|
||||
@override
|
||||
State<CreateNewPasswordBody> createState() => _CreateNewPasswordBodyState();
|
||||
}
|
||||
|
||||
class _CreateNewPasswordBodyState extends State<CreateNewPasswordBody> {
|
||||
late TextEditingController _passwordController;
|
||||
late TextEditingController _repeatPasswordController;
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
bool _isValid = false;
|
||||
|
||||
void _validateForm() {
|
||||
final isValid = _formKey.currentState?.validate() ?? false;
|
||||
if (_isValid != isValid) {
|
||||
setState(() {
|
||||
_isValid = isValid;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_passwordController = TextEditingController();
|
||||
_repeatPasswordController = TextEditingController();
|
||||
_passwordController.addListener(_validateForm);
|
||||
_repeatPasswordController.addListener(_validateForm);
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_passwordController.removeListener(_validateForm);
|
||||
_repeatPasswordController.removeListener(_validateForm);
|
||||
_passwordController.dispose();
|
||||
_repeatPasswordController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return WLayout(child: Scaffold());
|
||||
return Form(
|
||||
key: _formKey,
|
||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||
child: WLayout(
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: true,
|
||||
body: SingleChildScrollView(
|
||||
keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
30.verticalSpace,
|
||||
WBackButton(),
|
||||
20.verticalSpace,
|
||||
Text(
|
||||
context.loc.createNewPassword,
|
||||
style: context.appThemeTextStyles.size24Bold,
|
||||
),
|
||||
8.verticalSpace,
|
||||
Text(
|
||||
context.loc.createNewPasswordSubtitle,
|
||||
style: context.appThemeTextStyles.size14Regular,
|
||||
),
|
||||
|
||||
40.verticalSpace,
|
||||
Text(
|
||||
context.loc.newPassword,
|
||||
style: context.appThemeTextStyles.size16Medium,
|
||||
),
|
||||
10.verticalSpace,
|
||||
AppTextFormField(
|
||||
obscureText: true,
|
||||
controller: _passwordController,
|
||||
keyBoardType: TextInputType.visiblePassword,
|
||||
hintText: context.loc.enter_password,
|
||||
validator: (value) {
|
||||
return Validators.validatePassword(
|
||||
_passwordController.text.trim(),
|
||||
);
|
||||
},
|
||||
),
|
||||
16.verticalSpace,
|
||||
Text(
|
||||
context.loc.confirmNewPassword,
|
||||
style: context.appThemeTextStyles.size16Medium,
|
||||
),
|
||||
10.verticalSpace,
|
||||
AppTextFormField(
|
||||
obscureText: true,
|
||||
controller: _repeatPasswordController,
|
||||
keyBoardType: TextInputType.visiblePassword,
|
||||
hintText: context.loc.enter_password,
|
||||
validator: (value) {
|
||||
return Validators.validateRepeatPassword(
|
||||
_repeatPasswordController.text.trim(),
|
||||
_passwordController.text.trim(),
|
||||
);
|
||||
},
|
||||
),
|
||||
130.verticalSpace,
|
||||
AppButton(
|
||||
name: context.loc.resetPassword,
|
||||
isActive: _isValid,
|
||||
onPressed: () {
|
||||
ChangePasswordSuccessPassword().show(context);
|
||||
},
|
||||
),
|
||||
],
|
||||
).paddingSymmetric(horizontal: 24),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,8 +75,10 @@ class _ForgotPasswordBodyState extends State<ForgotPasswordBody> {
|
||||
),
|
||||
10.verticalSpace,
|
||||
AppTextFormField(
|
||||
|
||||
controller: _phoneNumberController,
|
||||
keyBoardType: TextInputType.number,
|
||||
hintText: context.loc.enter_email_or_phone,
|
||||
prefixIcon: Text(
|
||||
"+ 998",
|
||||
style: context.appThemeTextStyles.size14Regular,
|
||||
|
||||
@@ -123,7 +123,14 @@ class _VerifyAccountBodyState extends State<VerifyAccountBody> {
|
||||
AppButton(
|
||||
isActive: _isValid,
|
||||
name: context.loc.verifyAccount,
|
||||
onPressed: () {},
|
||||
onPressed: () {
|
||||
if (_formKey.currentState?.validate() ?? false) {
|
||||
context.push(
|
||||
Routes.createNewPassword,
|
||||
extra: widget.phoneNumber,
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
20.verticalSpace,
|
||||
Align(
|
||||
|
||||
@@ -101,8 +101,9 @@ class _AppTextFormFieldState extends State<AppTextFormField> {
|
||||
});
|
||||
},
|
||||
icon: SvgPicture.asset(
|
||||
visibility ? AppIcons.icVisibility : AppIcons.icVisibilityOff,
|
||||
color: AppColors.c000000,
|
||||
visibility
|
||||
? AppIcons.icVisibility
|
||||
: AppIcons.icVisibilityOff,
|
||||
),
|
||||
)
|
||||
: widget.suffixIcon,
|
||||
|
||||
@@ -6,7 +6,9 @@ class WBackButton extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
onTap: () {},
|
||||
onTap: () {
|
||||
context.pop();
|
||||
},
|
||||
borderRadius: AppUtils.kBorderRadius22,
|
||||
child: Ink(
|
||||
height: 44,
|
||||
|
||||
@@ -62,7 +62,7 @@ class _MyAppState extends State<MyApp> {
|
||||
debugShowCheckedModeBanner: false,
|
||||
theme: AppTheme.lightTheme,
|
||||
darkTheme: AppTheme.darkTheme,
|
||||
themeMode: ThemeMode.dark,
|
||||
themeMode: ThemeMode.light,
|
||||
// themeMode: themeState.themeMode,
|
||||
routerConfig: sl<AppRoutes>().router,
|
||||
locale: state.currentLocale,
|
||||
|
||||
Reference in New Issue
Block a user