refactor(diary): Even more refactoring

This commit is contained in:
2024-03-05 17:35:48 +03:00
parent 3cf61ce5ca
commit 3019a5a264
3 changed files with 75 additions and 57 deletions

View File

@@ -67,36 +67,43 @@ class _AllergiesScreenState extends State<AllergiesScreen> {
margin: EdgeInsets.only(
left: 16.h, right: 16.h, bottom: 50.v),
buttonStyle: CustomButtonStyles.outlinePrimaryTL15,
onPressed: () {
UserRegistrationSheet sheet =
state.allergiesModelObj!.userRegistrationSheet;
sheet.aboutAllergy =
state.enterInformationController!.text;
Navigator.pushNamed(
context,
AppRoutes.medicineIntakeScreen,
arguments: sheet,
);
});
onPressed: onTapContinue(state, context));
}),
BlocBuilder<AllergiesBloc, AllergiesState>(
builder: (context, state) {
return GestureDetector(
onTap: () {
UserRegistrationSheet sheet =
state.allergiesModelObj!.userRegistrationSheet;
Navigator.pushNamed(
context,
AppRoutes.medicineIntakeScreen,
arguments: sheet,
);
},
onTap: onTapSkip(state, context),
child: Text("skip".tr, style: theme.textTheme.bodyLarge),
);
}),
]))));
}
onTapSkip(AllergiesState state, BuildContext context) {
return () {
UserRegistrationSheet sheet =
state.allergiesModelObj!.userRegistrationSheet;
Navigator.pushNamed(
context,
AppRoutes.medicineIntakeScreen,
arguments: sheet,
);
};
}
onTapContinue(AllergiesState state, BuildContext context) {
return () {
UserRegistrationSheet sheet =
state.allergiesModelObj!.userRegistrationSheet;
sheet.aboutAllergy = state.enterInformationController!.text;
Navigator.pushNamed(
context,
AppRoutes.medicineIntakeScreen,
arguments: sheet,
);
};
}
/// Section Widget
_buildAppBar(BuildContext context) {
return CustomAppBar(
@@ -104,15 +111,19 @@ class _AllergiesScreenState extends State<AllergiesScreen> {
leading: AppbarLeadingImage(
imagePath: ImageConstant.imgArrowLeft,
margin: EdgeInsets.only(left: 18.h, top: 15.v, bottom: 15.v),
onTap: () {
onTapArrowLeft(context);
}),
onTap: onTapBack(context)),
centerTitle: true,
title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio));
}
onTapBack(BuildContext context) {
return () {
onTapArrowLeft(context);
};
}
/// Section Widget
Widget _buildTextFormField(BuildContext context) {
_buildTextFormField(BuildContext context) {
return Column(children: [
Text("fill_in_information".tr,
style: CustomTextStyles.titleMediumSegoeUI),