feature(registration): refactor i 4

This commit is contained in:
mso7nueh
2024-07-15 11:19:29 +03:00
parent 4780caf389
commit 8cf2388b18
12 changed files with 365 additions and 342 deletions

View File

@@ -1,6 +1,7 @@
import 'package:go_router/go_router.dart';
import 'bloc/allergies_bloc.dart';
// ignore: unused_import
import 'models/allergies_model.dart';
import 'package:eatvio_app/core/app_export.dart';
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
@@ -8,14 +9,9 @@ import 'package:eatvio_app/widgets/custom_text_form_field.dart';
import 'package:flutter/material.dart';
class AllergiesScreen extends StatefulWidget {
const AllergiesScreen({Key? key}) : super(key: key);
final UserRegistrationSheet sheet;
static Widget builder(BuildContext context, sheet) {
return BlocProvider<AllergiesBloc>(
create: (context) => AllergiesBloc(AllergiesState(allergiesModelObj: AllergiesModel(userRegistrationSheet: sheet)))..add(AllergiesInitialEvent()),
child: AllergiesScreen(),
);
}
const AllergiesScreen({super.key, required this.sheet});
@override
State<AllergiesScreen> createState() => _AllergiesScreenState();
@@ -27,33 +23,33 @@ class _AllergiesScreenState extends State<AllergiesScreen> {
return SingleChildScrollView(
padding: EdgeInsets.only(bottom: 80),
child: Container(
width: double.maxFinite,
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v),
child: Column(
children: [
Text("allergies_presence".tr, style: theme.textTheme.headlineSmall),
SizedBox(height: 22.v),
_buildTextFormField(context),
// BlocBuilder<AllergiesBloc, AllergiesState>(
// builder: (context, state) {
// return NextStepButton(
// text: "continue".tr.toUpperCase(),
// margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v),
// buttonStyle: CustomButtonStyles.outlinePrimaryTL15,
// onPressed: onTapContinue(state, context),
// );
// },
// ),
// BlocBuilder<AllergiesBloc, AllergiesState>(
// builder: (context, state) {
// return GestureDetector(
// onTap: onTapSkip(state, context),
// child: Text("skip".tr, style: theme.textTheme.bodyLarge),
// );
// },
// ),
],
),
width: double.maxFinite,
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v),
child: Column(
children: [
Text("allergies_presence".tr, style: theme.textTheme.headlineSmall),
SizedBox(height: 22.v),
_buildTextFormField(context),
// BlocBuilder<AllergiesBloc, AllergiesState>(
// builder: (context, state) {
// return NextStepButton(
// text: "continue".tr.toUpperCase(),
// margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v),
// buttonStyle: CustomButtonStyles.outlinePrimaryTL15,
// onPressed: onTapContinue(state, context),
// );
// },
// ),
// BlocBuilder<AllergiesBloc, AllergiesState>(
// builder: (context, state) {
// return GestureDetector(
// onTap: onTapSkip(state, context),
// child: Text("skip".tr, style: theme.textTheme.bodyLarge),
// );
// },
// ),
],
),
),
);
}