feat:resetting password done
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -98,7 +98,7 @@ class _VerifyAccountBodyState extends State<VerifyAccountBody> {
|
||||
Pinput(
|
||||
autofocus: true,
|
||||
enabled: true,
|
||||
length: 5,
|
||||
length: 5,
|
||||
controller: _otpController,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
@@ -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(
|
||||
|
||||
@@ -92,7 +92,7 @@ class _AppTextFormFieldState extends State<AppTextFormField> {
|
||||
widget.hintTextStyle ??
|
||||
context.appThemeTextStyles.size14Regular.copyWith(
|
||||
color: AppColors.cA7AEC1,
|
||||
),
|
||||
),
|
||||
suffixIcon: widget.obscureText
|
||||
? IconButton(
|
||||
onPressed: () {
|
||||
@@ -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,
|
||||
@@ -19,7 +21,7 @@ class WBackButton extends StatelessWidget {
|
||||
color: AppColors.cA7AEC1.newWithOpacity(.3),
|
||||
offset: const Offset(0, 4),
|
||||
blurRadius: 80,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: SvgPicture.asset(
|
||||
|
||||
@@ -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