bottomNav

This commit is contained in:
2025-01-21 18:58:52 +05:30
parent 9fee5eb24d
commit 26aaa8c4e8
7 changed files with 250 additions and 182 deletions

View File

@@ -1,10 +1,13 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:go_router/go_router.dart';
import 'package:grocery_app/src/common_widget/textfield_widget.dart';
import 'package:grocery_app/src/core/routes/routes.dart';
import 'package:grocery_app/src/ui/bottomnavigation/bottom_bar_widget.dart';
import 'package:grocery_app/utils/constants/assets_constant.dart';
import 'package:grocery_app/utils/constants/color_constant.dart';
import 'package:grocery_app/utils/constants/string_constant.dart';
import 'package:grocery_app/utils/extensions/extensions.dart';
import 'package:grocery_app/utils/extensions/uicontext.dart';
class EnterFullNameScreen extends StatefulWidget {
@@ -15,6 +18,9 @@ class EnterFullNameScreen extends StatefulWidget {
}
class _EnterFullNameScreenState extends State<EnterFullNameScreen> {
final _formKey = GlobalKey<FormState>();
@override
Widget build(BuildContext context) {
return Scaffold(
@@ -42,10 +48,33 @@ class _EnterFullNameScreenState extends State<EnterFullNameScreen> {
style: context.customMedium(APPCOLOR.black333333, 18),
),
const SizedBox(height: 30),
AppTextFieldWidget(
controller: TextEditingController(),
hintText: APPSTRING.fullNameHint,
),
Form(
key: _formKey,
child: Column(
children: [
AppTextFieldWidget(
controller: TextEditingController(),
hintText: APPSTRING.firstNameHint,
onValidate: (value){
if (value == null || value.isEmpty) {
return 'Please Enter first Name';
}
return null;
},
),
AppTextFieldWidget(
controller: TextEditingController(),
hintText: APPSTRING.lastNameHint,
onValidate: (value){
if (value == null || value.isEmpty) {
return 'Please Enter last Name';
}
return null;
},
),
],
),
)
],
),
),
@@ -60,16 +89,25 @@ class _EnterFullNameScreenState extends State<EnterFullNameScreen> {
child: Center(
child: InkWell(
onTap: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) {
return const BottomBarWidget();
},
));
if (_formKey.currentState?.validate() ?? false) {
context.clearAndPush( routePath: MyRoutes.BOTTOMNAV);
}
// Navigator.of(context).push(MaterialPageRoute(
// builder: (context) {
// return const BottomBarWidget();
// },
// ));
},
child: Container(
height: 50,
width: MediaQuery.sizeOf(context).width,
decoration: BoxDecoration(color: APPCOLOR.appGreen, borderRadius: BorderRadius.circular(4)),
decoration: BoxDecoration(
color: APPCOLOR.appGreen,
borderRadius: BorderRadius.circular(4)),
child: Center(
child: Text(
APPSTRING.continueBtn,

View File

@@ -1,5 +1,7 @@
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:grocery_app/src/common_widget/textfield_widget.dart';
import 'package:grocery_app/src/core/routes/routes.dart';
import 'package:grocery_app/src/ui/otp/otp_screen.dart';
import 'package:grocery_app/utils/constants/color_constant.dart';
import 'package:grocery_app/utils/constants/string_constant.dart';
@@ -80,12 +82,16 @@ class _LoginScreenState extends State<LoginScreen> {
child: InkWell(
onTap: () {
print("djkhfjdgf ${_formKey.currentState?.validate()}");
if (_formKey.currentState?.validate() ?? false) {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) {
return const OtpScreen();
},
));
if (_formKey.currentState?.validate() ?? false)
{
context.push(MyRoutes.OTPSCREEN);
// Navigator.of(context).push(MaterialPageRoute(
// builder: (context)
// {
// return const OtpScreen();
// },
// ));
}
},
child: Container(

View File

@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:go_router/go_router.dart';
import 'package:grocery_app/src/ui/entername/enter_fullname_screen.dart';
import 'package:grocery_app/utils/constants/assets_constant.dart';
import 'package:grocery_app/utils/constants/color_constant.dart';
@@ -9,6 +10,8 @@ import 'package:grocery_app/utils/extensions/uicontext.dart';
import 'package:otp_text_field/otp_text_field.dart';
import 'package:otp_text_field/style.dart';
import '../../core/routes/routes.dart';
class OtpScreen extends StatefulWidget {
const OtpScreen({super.key});
@@ -34,10 +37,9 @@ class _OtpScreenState extends State<OtpScreen> {
children: [
const SizedBox(height: 30),
InkWell(
onTap: ()
{
onTap: () {
Navigator.of(context).pop();
},
},
child: SvgPicture.asset(APPASSETS.back)),
const SizedBox(height: 30),
Text(
@@ -54,15 +56,17 @@ class _OtpScreenState extends State<OtpScreen> {
const SizedBox(height: 20),
OTPTextField(
length: 6,
onChanged: (c)
{
if (c.length == 6)
{
Navigator.push(context, MaterialPageRoute(
builder: (context) {
return const EnterFullNameScreen();
},
));
onChanged: (c) {
if (c.length == 6)
{
context.push(MyRoutes.FULLNAME);
// Navigator.push(context, MaterialPageRoute(
// builder: (context)
// {
// return const EnterFullNameScreen();
// },
// ));
}
},
width: MediaQuery.of(context).size.width,
@@ -79,12 +83,15 @@ class _OtpScreenState extends State<OtpScreen> {
height: 10,
),
RichText(
text: TextSpan(text: 'Didnt get the code? ', style: context.customRegular(APPCOLOR.gery48514D, 14), children: [
TextSpan(
text: 'Resend',
style: context.customRegular(APPCOLOR.appGreen, 14),
)
]))
text: TextSpan(
text: 'Didnt get the code? ',
style: context.customRegular(APPCOLOR.gery48514D, 14),
children: [
TextSpan(
text: 'Resend',
style: context.customRegular(APPCOLOR.appGreen, 14),
)
]))
],
),
),