feat:verify phone number page ui done

This commit is contained in:
jahongireshonqulov
2025-10-29 15:51:55 +05:00
parent a2fbd9f90d
commit 5e4d362039
17 changed files with 264 additions and 6 deletions

View File

@@ -105,7 +105,7 @@ class _WLoginBodyState extends State<WLoginBody> {
alignment: AlignmentGeometry.centerRight,
child: TextButton(
onPressed: () {
context.push(Routes.forgotPassword);
context.push(Routes.verifyPhoneNumber, extra: false);
},
child: Text(
context.loc.forgot_password,
@@ -148,7 +148,10 @@ class _WLoginBodyState extends State<WLoginBody> {
),
TextButton(
onPressed: () {
context.pushReplacement(Routes.register);
context.push(
Routes.verifyPhoneNumber,
extra: true,
);
},
child: Text(
context.loc.sign_up,

View File

@@ -0,0 +1,22 @@
import 'package:food_delivery_client/feature/auth/presentation/widgets/w_auth_background.dart';
import '../../../../../food_delivery_client.dart';
class ResetPasswordPage extends StatelessWidget {
const ResetPasswordPage({super.key});
@override
Widget build(BuildContext context) {
return WLayout(
top: false,
child: Scaffold(
body: WAuthBackground(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [],
),
),
),
);
}
}

View File

@@ -0,0 +1,17 @@
import 'package:food_delivery_client/feature/auth/presentation/widgets/w_auth_background.dart';
import '../../../../../food_delivery_client.dart';
class VerifyOtpCodePage extends StatelessWidget {
const VerifyOtpCodePage({super.key, required this.isRegister});
final bool isRegister;
@override
Widget build(BuildContext context) {
return WLayout(
top: false,
child: Scaffold(body: WAuthBackground(child: Column())),
);
}
}

View File

@@ -0,0 +1,96 @@
import 'package:food_delivery_client/core/helpers/formatters.dart';
import 'package:food_delivery_client/core/helpers/validator_helpers.dart';
import 'package:food_delivery_client/feature/auth/presentation/widgets/w_auth_background.dart';
import '../../../../../food_delivery_client.dart';
class VerifyPhoneNumberPage extends StatefulWidget {
const VerifyPhoneNumberPage({super.key, required this.isRegister});
final bool isRegister;
@override
State<VerifyPhoneNumberPage> createState() => _VerifyPhoneNumberPageState();
}
class _VerifyPhoneNumberPageState extends State<VerifyPhoneNumberPage> {
late TextEditingController _phoneNumberController;
final _formKey = GlobalKey<FormState>();
@override
void initState() {
_phoneNumberController = TextEditingController();
super.initState();
}
@override
void dispose() {
_phoneNumberController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Form(
key: _formKey,
child: WLayout(
top: false,
child: Scaffold(
body: WAuthBackground(
child: SizedBox(
width: context.w,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
50.verticalSpace,
Text(
context.loc.enter_phone_number,
style: AppTextStyles.size20Medium,
),
20.verticalSpace,
AppTextFormField(
controller: _phoneNumberController,
borderRadius: AppUtils.kBorderRadius8,
hintText: context.loc.phone_number,
keyBoardType: TextInputType.phone,
inputFormatters: [
FilteringTextInputFormatter.digitsOnly,
Formatters.phoneFormatter,
LengthLimitingTextInputFormatter(12),
],
prefixIcon: Text(
"+ 998",
style: AppTextStyles.size16Regular,
),
validator: (value) {
return Validators.validatePhoneNumber(
_phoneNumberController.text.trim(),
);
},
),
25.verticalSpace,
AppButton(
onPressed: () {
if (_formKey.currentState?.validate() ?? false) {}
},
name: context.loc.continue_str,
borderRadius: 15,
backgroundColor: AppColors.c34A853,
),
10.verticalSpace,
Text(
context.loc.consent_message("Felix Eats"),
style: AppTextStyles.size12Medium.copyWith(
color: AppColors.c888888,
),
),
],
).paddingSymmetric(horizontal: 16),
),
),
),
),
);
}
}

View File

@@ -1,2 +1,3 @@
export 'presentation/widgets/widgets.dart';
export 'presentation/blocs/language_bloc/language_bloc.dart';
export 'presentation/blocs/language_bloc/language_bloc.dart';
export 'data/models/success_model.dart';

View File

@@ -0,0 +1,38 @@
import 'package:equatable/equatable.dart';
class SuccessModel extends Equatable {
final String message;
final bool success;
const SuccessModel({
required this.message,
required this.success,
});
factory SuccessModel.fromJson(Map<String, dynamic> json) {
return SuccessModel(
message: json['message'] as String? ?? '',
success: json['success'] as bool? ?? false,
);
}
Map<String, dynamic> toJson() {
return {
'message': message,
'success': success,
};
}
SuccessModel copyWith({
String? message,
bool? success,
}) {
return SuccessModel(
message: message ?? this.message,
success: success ?? this.success,
);
}
@override
List<Object?> get props => [message, success];
}