diff --git a/lib/localization/ru/ru_translations.dart b/lib/localization/ru/ru_translations.dart index 012f1bda..40badc28 100644 --- a/lib/localization/ru/ru_translations.dart +++ b/lib/localization/ru/ru_translations.dart @@ -36,6 +36,8 @@ final Map ru = { "do_you_have_hypertension_tendency": "Есть ли у вас склонность к гипертонии?", "your_blood_pressure": "Ваше артериальное давление?", "average_pressure": "Средние показатели давления:", + "up_pressure": "Верхние показатели давления:", + "down_pressure": "Нижние показатели давления:", "do_you_have_hypotension_tendency": "Есть ли у вас склонность к гипотонии?", // favorite_sports Screen diff --git a/lib/presentation/additional_information_screen/additional_information_screen.dart b/lib/presentation/additional_information_screen/additional_information_screen.dart index 295a98d7..f93ed9d3 100644 --- a/lib/presentation/additional_information_screen/additional_information_screen.dart +++ b/lib/presentation/additional_information_screen/additional_information_screen.dart @@ -59,13 +59,12 @@ class _AdditionalInformationScreenState _buildTextFormField(context), Spacer(), CustomOutlinedButton( - text: "continue".tr.toUpperCase(), + text: "finish".tr.toUpperCase(), buttonStyle: CustomButtonStyles.outlinePrimaryTL15, onPressed: () { showSuccessMessage(context); }), SizedBox(height: 17.v), - Text("finish".tr, style: theme.textTheme.bodyLarge) ])))); } diff --git a/lib/presentation/blood_pressure_screen/bloc/blood_pressure_bloc.dart b/lib/presentation/blood_pressure_screen/bloc/blood_pressure_bloc.dart index 9d0a083d..8eefb84b 100644 --- a/lib/presentation/blood_pressure_screen/bloc/blood_pressure_bloc.dart +++ b/lib/presentation/blood_pressure_screen/bloc/blood_pressure_bloc.dart @@ -32,7 +32,8 @@ class BloodPressureBloc extends Bloc { ) async { emit(state.copyWith( valueController: TextEditingController(), - valueController1: TextEditingController())); + valueController1: TextEditingController(), + valueController2: TextEditingController())); emit(state.copyWith( bloodPressureModelObj: state.bloodPressureModelObj ?.copyWith(dropdownItemList: fillDropdownItemList()))); diff --git a/lib/presentation/blood_pressure_screen/bloc/blood_pressure_state.dart b/lib/presentation/blood_pressure_screen/bloc/blood_pressure_state.dart index e43ee812..08bdff74 100644 --- a/lib/presentation/blood_pressure_screen/bloc/blood_pressure_state.dart +++ b/lib/presentation/blood_pressure_screen/bloc/blood_pressure_state.dart @@ -7,6 +7,7 @@ class BloodPressureState extends Equatable { BloodPressureState({ this.valueController, this.valueController1, + this.valueController2, this.selectedDropDownValue, this.bloodPressureModelObj, }); @@ -15,6 +16,8 @@ class BloodPressureState extends Equatable { TextEditingController? valueController1; + TextEditingController? valueController2; + SelectionPopupModel? selectedDropDownValue; BloodPressureModel? bloodPressureModelObj; @@ -29,6 +32,7 @@ class BloodPressureState extends Equatable { BloodPressureState copyWith({ TextEditingController? valueController, TextEditingController? valueController1, + TextEditingController? valueController2, SelectionPopupModel? selectedDropDownValue, BloodPressureModel? bloodPressureModelObj, }) { diff --git a/lib/presentation/blood_pressure_screen/blood_pressure_screen.dart b/lib/presentation/blood_pressure_screen/blood_pressure_screen.dart index a1c940af..b005a3be 100644 --- a/lib/presentation/blood_pressure_screen/blood_pressure_screen.dart +++ b/lib/presentation/blood_pressure_screen/blood_pressure_screen.dart @@ -63,8 +63,40 @@ class _BloodPressureScreenState extends State { overflow: TextOverflow.ellipsis, textAlign: TextAlign.center, style: theme.textTheme.headlineSmall)), - SizedBox(height: 77.v), - _buildThirtyThree(context), + SizedBox(height: 21.v), + Container( + margin: EdgeInsets.only(right: 1.h), + padding: EdgeInsets.symmetric(horizontal: 3.h), + child: Column(children: [ + Text("up_pressure".tr, + style: theme.textTheme.bodyLarge), + SizedBox(height: 2.v), + BlocSelector( + selector: (state) => state.valueController1, + builder: (context, valueController1) { + return CustomTextFormField( + controller: valueController1, + hintText: "90".tr); + }) + ])), + SizedBox(height: 21.v), + Container( + margin: EdgeInsets.only(right: 1.h), + padding: EdgeInsets.symmetric(horizontal: 3.h), + child: Column(children: [ + Text("down_pressure".tr, + style: theme.textTheme.bodyLarge), + SizedBox(height: 2.v), + BlocSelector( + selector: (state) => state.valueController2, + builder: (context, valueController2) { + return CustomTextFormField( + controller: valueController2, + hintText: "90".tr); + }) + ])), SizedBox(height: 22.v), Text("do_you_have_hypotension_tendency".tr, style: theme.textTheme.bodyLarge), diff --git a/lib/presentation/favorite_foods_screen/favorite_foods_screen.dart b/lib/presentation/favorite_foods_screen/favorite_foods_screen.dart index c3d58c68..2ee032e7 100644 --- a/lib/presentation/favorite_foods_screen/favorite_foods_screen.dart +++ b/lib/presentation/favorite_foods_screen/favorite_foods_screen.dart @@ -69,7 +69,7 @@ class _FavoriteFoodsScreenState extends State { text: "continue".tr.toUpperCase(), buttonStyle: CustomButtonStyles.outlinePrimaryTL15, onPressed: () { - navigateToSchedule(context); + navigateToAdditionalInformationScreen(context); }), SizedBox(height: 17.v), Text("skip".tr, style: theme.textTheme.bodyLarge) @@ -90,23 +90,6 @@ class _FavoriteFoodsScreenState extends State { title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio)); } - /// Section Widget - Widget _buildProgressIndicator(BuildContext context) { - return Container( - width: 343.h, - padding: EdgeInsets.symmetric(horizontal: 4.h, vertical: 3.v), - decoration: AppDecoration.outlinePrimary - .copyWith(borderRadius: BorderRadiusStyle.circleBorder8), - child: Container( - height: 8.v, - width: 279.h, - decoration: BoxDecoration( - color: appTheme.blueA400, - borderRadius: BorderRadius.circular(4.h), - border: - Border.all(color: theme.colorScheme.primary, width: 1.h)))); - } - /// Section Widget Widget _buildTextFormField(BuildContext context) { return Column(children: [ @@ -148,9 +131,9 @@ class _FavoriteFoodsScreenState extends State { } /// Navigates to the scheduleScreen when the action is triggered. - navigateToSchedule(BuildContext context) { + navigateToAdditionalInformationScreen(BuildContext context) { NavigatorService.pushNamed( - AppRoutes.scheduleScreen, + AppRoutes.additionalInformationScreen, ); } } diff --git a/lib/presentation/schedule_screen/bloc/schedule_bloc.dart b/lib/presentation/schedule_screen/bloc/schedule_bloc.dart deleted file mode 100644 index 6dedad4a..00000000 --- a/lib/presentation/schedule_screen/bloc/schedule_bloc.dart +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:equatable/equatable.dart'; -import 'package:flutter/material.dart'; -import '/core/app_export.dart'; -import 'package:eatvio_app/presentation/schedule_screen/models/schedule_model.dart'; -part 'schedule_event.dart'; -part 'schedule_state.dart'; - -/// A bloc that manages the state of a Schedule according to the event that is dispatched to it. -class ScheduleBloc extends Bloc { - ScheduleBloc(ScheduleState initialState) : super(initialState) { - on(_onInitialize); - } - - _onInitialize( - ScheduleInitialEvent event, - Emitter emit, - ) async { - emit(state.copyWith(inputPlaceholderController: TextEditingController())); - } -} diff --git a/lib/presentation/schedule_screen/bloc/schedule_event.dart b/lib/presentation/schedule_screen/bloc/schedule_event.dart deleted file mode 100644 index 711e4eaf..00000000 --- a/lib/presentation/schedule_screen/bloc/schedule_event.dart +++ /dev/null @@ -1,16 +0,0 @@ -// ignore_for_file: must_be_immutable - -part of 'schedule_bloc.dart'; - -/// Abstract class for all events that can be dispatched from the -///Schedule widget. -/// -/// Events must be immutable and implement the [Equatable] interface. -@immutable -abstract class ScheduleEvent extends Equatable {} - -/// Event that is dispatched when the Schedule widget is first created. -class ScheduleInitialEvent extends ScheduleEvent { - @override - List get props => []; -} diff --git a/lib/presentation/schedule_screen/bloc/schedule_state.dart b/lib/presentation/schedule_screen/bloc/schedule_state.dart deleted file mode 100644 index 4c345db8..00000000 --- a/lib/presentation/schedule_screen/bloc/schedule_state.dart +++ /dev/null @@ -1,31 +0,0 @@ -// ignore_for_file: must_be_immutable - -part of 'schedule_bloc.dart'; - -/// Represents the state of Schedule in the application. -class ScheduleState extends Equatable { - ScheduleState({ - this.inputPlaceholderController, - this.scheduleModelObj, - }); - - TextEditingController? inputPlaceholderController; - - ScheduleModel? scheduleModelObj; - - @override - List get props => [ - inputPlaceholderController, - scheduleModelObj, - ]; - ScheduleState copyWith({ - TextEditingController? inputPlaceholderController, - ScheduleModel? scheduleModelObj, - }) { - return ScheduleState( - inputPlaceholderController: - inputPlaceholderController ?? this.inputPlaceholderController, - scheduleModelObj: scheduleModelObj ?? this.scheduleModelObj, - ); - } -} diff --git a/lib/presentation/schedule_screen/models/schedule_model.dart b/lib/presentation/schedule_screen/models/schedule_model.dart deleted file mode 100644 index 6eb1022f..00000000 --- a/lib/presentation/schedule_screen/models/schedule_model.dart +++ /dev/null @@ -1,16 +0,0 @@ -// ignore_for_file: must_be_immutable - -import 'package:equatable/equatable.dart'; - -/// This class defines the variables used in the [schedule_screen], -/// and is typically used to hold data that is passed between different parts of the application. -class ScheduleModel extends Equatable { - ScheduleModel() {} - - ScheduleModel copyWith() { - return ScheduleModel(); - } - - @override - List get props => []; -} diff --git a/lib/presentation/schedule_screen/schedule_screen.dart b/lib/presentation/schedule_screen/schedule_screen.dart deleted file mode 100644 index 636bea39..00000000 --- a/lib/presentation/schedule_screen/schedule_screen.dart +++ /dev/null @@ -1,137 +0,0 @@ -import 'bloc/schedule_bloc.dart'; -import 'models/schedule_model.dart'; -import 'package:eatvio_app/core/app_export.dart'; -import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.dart'; -import 'package:eatvio_app/widgets/app_bar/appbar_title_image.dart'; -import 'package:eatvio_app/widgets/app_bar/custom_app_bar.dart'; -import 'package:eatvio_app/widgets/custom_outlined_button.dart'; -import 'package:eatvio_app/widgets/custom_text_form_field.dart'; -import 'package:flutter/material.dart'; - -class ScheduleScreen extends StatefulWidget { - const ScheduleScreen({Key? key}) : super(key: key); - - static Widget builder(BuildContext context) { - return BlocProvider( - create: (context) => - ScheduleBloc(ScheduleState(scheduleModelObj: ScheduleModel())) - ..add(ScheduleInitialEvent()), - child: ScheduleScreen()); - } - - @override - State createState() => _ScheduleScreenState(); -} - -class _ScheduleScreenState extends State { - @override - Widget build(BuildContext context) { - mediaQueryData = MediaQuery.of(context); - return SafeArea( - child: Scaffold( - resizeToAvoidBottomInset: false, - appBar: _buildAppBar(context), - body: Container( - width: double.maxFinite, - padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v), - child: Column(children: [ - SizedBox(height: 7.v), - Container( - height: 16.v, - width: 343.h, - decoration: BoxDecoration( - color: theme.colorScheme.onPrimary, - borderRadius: BorderRadius.circular(8.h), - border: Border.all( - color: theme.colorScheme.primary, width: 1.h)), - child: ClipRRect( - borderRadius: BorderRadius.circular(8.h), - child: LinearProgressIndicator( - value: 0.95, - backgroundColor: theme.colorScheme.onPrimary, - valueColor: AlwaysStoppedAnimation( - appTheme.blueA400)))), - SizedBox(height: 38.v), - Text("your_schedule".tr, - style: theme.textTheme.headlineSmall), - SizedBox(height: 67.v), - _buildTextFormField(context), - Spacer(), - CustomOutlinedButton( - text: "continue".tr.toUpperCase(), - buttonStyle: CustomButtonStyles.outlinePrimaryTL15, - onPressed: () { - navigateToAdditional(context); - }), - SizedBox(height: 17.v), - Text("skip".tr, style: theme.textTheme.bodyLarge) - ])))); - } - - /// Section Widget - PreferredSizeWidget _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); - }), - centerTitle: true, - title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio)); - } - - /// Section Widget - Widget _buildProgressIndicator(BuildContext context) { - return Container( - width: 343.h, - padding: EdgeInsets.symmetric(horizontal: 4.h, vertical: 3.v), - decoration: AppDecoration.outlinePrimary - .copyWith(borderRadius: BorderRadiusStyle.circleBorder8), - child: Container( - height: 8.v, - width: 297.h, - decoration: BoxDecoration( - color: appTheme.blueA400, - borderRadius: BorderRadius.circular(4.h), - border: - Border.all(color: theme.colorScheme.primary, width: 1.h)))); - } - - /// Section Widget - Widget _buildTextFormField(BuildContext context) { - return Column(children: [ - Container( - width: 324.h, - margin: EdgeInsets.symmetric(horizontal: 9.h), - child: Text("tell_your_schedule".tr, - maxLines: 3, - overflow: TextOverflow.ellipsis, - textAlign: TextAlign.center, - style: CustomTextStyles.titleMediumSegoeUI)), - SizedBox(height: 12.v), - BlocSelector( - selector: (state) => state.inputPlaceholderController, - builder: (context, inputPlaceholderController) { - return CustomTextFormField( - controller: inputPlaceholderController, - hintText: "enter_information".tr, - textInputAction: TextInputAction.done, - maxLines: 8); - }) - ]); - } - - /// Navigates to the previous screen. - onTapArrowLeft(BuildContext context) { - NavigatorService.goBack(); - } - - /// Navigates to the additionalInformationScreen when the action is triggered. - navigateToAdditional(BuildContext context) { - NavigatorService.pushNamed( - AppRoutes.additionalInformationScreen, - ); - } -} diff --git a/lib/routes/app_routes.dart b/lib/routes/app_routes.dart index a9adebc0..0fd6f29e 100644 --- a/lib/routes/app_routes.dart +++ b/lib/routes/app_routes.dart @@ -1,4 +1,3 @@ -import 'package:eatvio_app/presentation/credentials_screen/models/credentials_model.dart'; import 'package:flutter/material.dart'; import 'package:eatvio_app/presentation/date_of_birth_screen/date_of_birth_screen.dart'; import 'package:eatvio_app/presentation/city_of_living_screen/city_of_living_screen.dart'; @@ -11,7 +10,6 @@ import 'package:eatvio_app/presentation/gender_screen/gender_screen.dart'; import 'package:eatvio_app/presentation/blood_pressure_screen/blood_pressure_screen.dart'; import 'package:eatvio_app/presentation/favorite_sports_screen/favorite_sports_screen.dart'; import 'package:eatvio_app/presentation/favorite_foods_screen/favorite_foods_screen.dart'; -import 'package:eatvio_app/presentation/schedule_screen/schedule_screen.dart'; import 'package:eatvio_app/presentation/additional_information_screen/additional_information_screen.dart'; import 'package:eatvio_app/presentation/language_select_screen/language_select_screen.dart'; import 'package:eatvio_app/presentation/height_screen/height_screen.dart'; @@ -76,7 +74,6 @@ class AppRoutes { bloodPressureScreen: BloodPressureScreen.builder, favoriteSportsScreen: FavoriteSportsScreen.builder, favoriteFoodsScreen: FavoriteFoodsScreen.builder, - scheduleScreen: ScheduleScreen.builder, additionalInformationScreen: AdditionalInformationScreen.builder, languageSelectScreen: LanguageSelectScreen.builder, appNavigationScreen: AppNavigationScreen.builder,