diff --git a/lib/presentation/registration/medicine_intake_screen/medicine_intake_screen.dart b/lib/presentation/registration/medicine_intake_screen/medicine_intake_screen.dart index fc0766f6..51df64aa 100644 --- a/lib/presentation/registration/medicine_intake_screen/medicine_intake_screen.dart +++ b/lib/presentation/registration/medicine_intake_screen/medicine_intake_screen.dart @@ -74,52 +74,63 @@ class _MedicineIntakeScreenState extends State { margin: EdgeInsets.only( left: 16.h, right: 16.h, bottom: 50.v), buttonStyle: CustomButtonStyles.outlinePrimaryTL15, - onPressed: () { - UserRegistrationSheet sheet = state - .medicineIntakeModelObj!.userRegistrationSheet; - sheet.aboutTakingPils = - state.enterInformationController!.text; - Navigator.pushNamed( - context, - AppRoutes.bloodPressureScreen, - arguments: sheet, - ); - }); + onPressed: onTapNext(state, context)); }), BlocBuilder( builder: (context, state) { return GestureDetector( - onTap: () { - UserRegistrationSheet sheet = - state.medicineIntakeModelObj!.userRegistrationSheet; - Navigator.pushNamed( - context, - AppRoutes.bloodPressureScreen, - arguments: sheet, - ); - }, + onTap: onTapSkip(state, context), child: Text("skip".tr, style: theme.textTheme.bodyLarge), ); }), ])))); } + onTapSkip(MedicineIntakeState state, BuildContext context) { + return () { + UserRegistrationSheet sheet = + state.medicineIntakeModelObj!.userRegistrationSheet; + Navigator.pushNamed( + context, + AppRoutes.bloodPressureScreen, + arguments: sheet, + ); + }; + } + + onTapNext(MedicineIntakeState state, BuildContext context) { + return () { + UserRegistrationSheet sheet = + state.medicineIntakeModelObj!.userRegistrationSheet; + sheet.aboutTakingPils = state.enterInformationController!.text; + Navigator.pushNamed( + context, + AppRoutes.bloodPressureScreen, + arguments: sheet, + ); + }; + } + /// Section Widget - PreferredSizeWidget _buildAppBar(BuildContext context) { + _buildAppBar(BuildContext context) { return CustomAppBar( leadingWidth: 31.h, 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)); } + Function 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),