From a35f82794ab80fe8d1b7f34da80bf2ab1e39910b Mon Sep 17 00:00:00 2001 From: maxxkim Date: Mon, 18 Dec 2023 16:04:51 +0300 Subject: [PATCH] Added navigation between screens --- .dhiwise/config | 2 +- .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 2706 -> 2706 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 1936 -> 1936 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 3367 -> 3367 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 5029 -> 5029 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 6682 -> 6682 bytes android/build.gradle | 2 +- .../Icon-App-1024x1024@1x.png | Bin 39562 -> 39562 bytes .../AppIcon.appiconset/Icon-App-20x20@1x.png | Bin 1595 -> 1595 bytes .../AppIcon.appiconset/Icon-App-20x20@2x.png | Bin 1763 -> 1763 bytes .../AppIcon.appiconset/Icon-App-20x20@3x.png | Bin 2441 -> 2441 bytes .../AppIcon.appiconset/Icon-App-29x29@1x.png | Bin 1306 -> 1306 bytes .../AppIcon.appiconset/Icon-App-29x29@2x.png | Bin 2431 -> 2431 bytes .../AppIcon.appiconset/Icon-App-29x29@3x.png | Bin 3581 -> 3581 bytes .../AppIcon.appiconset/Icon-App-40x40@1x.png | Bin 1763 -> 1763 bytes .../AppIcon.appiconset/Icon-App-40x40@2x.png | Bin 3304 -> 3304 bytes .../AppIcon.appiconset/Icon-App-40x40@3x.png | Bin 4889 -> 4889 bytes .../AppIcon.appiconset/Icon-App-60x60@2x.png | Bin 4889 -> 4889 bytes .../AppIcon.appiconset/Icon-App-60x60@3x.png | Bin 7388 -> 7388 bytes .../AppIcon.appiconset/Icon-App-76x76@1x.png | Bin 3144 -> 3144 bytes .../AppIcon.appiconset/Icon-App-76x76@2x.png | Bin 6244 -> 6244 bytes .../Icon-App-83.5x83.5@2x.png | Bin 6918 -> 6918 bytes .../additional_information_screen.dart | 25 ++- .../allergies_screen/allergies_screen.dart | 13 +- .../blood_pressure_screen.dart | 12 +- .../body_circumferences_screen.dart | 13 +- .../city_of_living_screen.dart | 13 +- .../date_of_birth_screen.dart | 34 +++- .../favorite_foods_screen.dart | 13 +- .../bloc/favorite_sports_bloc.dart | 4 +- .../favorite_sports_screen.dart | 157 ++++++--------- .../gender_screen/gender_screen.dart | 13 +- .../bloc/language_select_bloc.dart | 25 +-- .../language_select_screen.dart | 188 +++++++----------- .../medicine_intake_screen.dart | 13 +- .../schedule_screen/schedule_screen.dart | 13 +- .../weight_screen/weight_screen.dart | 13 +- 37 files changed, 309 insertions(+), 244 deletions(-) diff --git a/.dhiwise/config b/.dhiwise/config index f825776a..580683ab 100644 --- a/.dhiwise/config +++ b/.dhiwise/config @@ -1,3 +1,3 @@ TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoiNjU3ZmYzZmVjMzBjMTkwMDFjZTZiNTM4IiwiX2lkIjoiNjU3ZmYzZmVjMzBjMTkwMDFjZTZiNTM4In0sImNvbXBhbnlJZCI6IjY1N2ZmM2ZlYzMwYzE5MDAxY2U2YjUzYSIsImFwcGxpY2F0aW9uSWQiOiI2NTdmZmI0NGE1ZDdiNDAwMjIzMGEwZWMiLCJpYXQiOjE3MDI4ODYyMTJ9.24JeUo8jgiAwKQkeKhwu49qjWT2CnXAoQrDmduDL0d0 SEMANTIC_VERSION = 1.0 -VERSION_NUMBER = 3 \ No newline at end of file +VERSION_NUMBER = 6 \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png index 35c33dfbfd11eab56845d87c22e00e624f6bc8d8..fa6d7bbd74ba787d10f2f1e33386d6cc5ce9f23c 100644 GIT binary patch delta 62 zcmbOvI!ScG1a=-37WP;AAseUna|#++8Jk%dm}naqSQ!}jCLKwfY|f>CDr#e2b9ZtE Gmlgmd)Das1 delta 62 zcmbOvI!ScG1a@vQWv}};PH&vv&nakVWn^S!Y^rTwU}az+V0znWvN@Lms%T{Rn*45=I-Rb GJX!!Q`w|rZ delta 62 zcmZ23wOne#1a@vQWv}};PH&v9!Xs#CWn^S!Y^rTwU}az+V0znW@);flRMEtYK_e?;Gb;lVZ36=<0|VcrBZ-ssXDOhH+Su3Jot!XB3jnm&5EuXe delta 53 xcmeC$%G9-$X@lG>K|?DeBP(N5Z36=<0|Nom+fI}9XDOhHCT1l6o18F93jnE~5BLB8 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png index 255d38a47ca16dcb78df2a2d27774c97f615e738..45ded3ac70cb891100f62acf26bc77edf1834ece 100644 GIT binary patch delta 64 zcmdnZvzuoFBMUo^3Jd!y{gBNZEXNrIjjW8#tPD)F4GgRd41AN0Bu;+7s(>nLV_$Q3 IvLKrl03qNI-~a#s delta 64 zcmdnZvzuoFBMUpXn6lUX8>csOupDO;G_*1@vNAT+HZZUN diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png index 19bdca9aed95fb07aece7481366505617db898db..d926afb9022bd4a775767b3c110422cbca0cdd7f 100644 GIT binary patch delta 62 zcmeAa?i8Ldft^Q%h5eO&$j0ey9D+tx#%5LqCfWuDRt5&XNkv1ZeirU!M+?^cH GsRaNWxe(_7 delta 62 zcmeAa?i8Ldft_1S+3Ws|(;KI^aR?e(85vm_n`#>vSQ!`ynBI1ptjDQ#){BLqR GrxpNL^%5@t diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png index 5d8314bace8640877c4f1d3eb33819559f650c2f..e4068b4cfc3510cf0271db4303c4db520b9c1b55 100644 GIT binary patch delta 62 zcmbQmHH&M)1a=-37WP;AAseTQvj`el8Jk%dm}naqSQ!}jCLKwfyq`q@Rn*45=I-PV GELs2?PZ68| delta 62 zcmbQmHH&M)1a@vQWv}};PH&tp&LU`NWn^S!Y^rTwU}az+V0znW@_rTtRMEtY{a1Rz1a=-37WP;AAseUv;&C#vGB&d^Fwr(Jure_4O*)duz`&qd;u=wsl30>z im7AZEnO4bQWME{hYiOivXc1zFqQS<#=I-RnyjlR_mKuQo delta 89 zcmew>{a1Rz1a@vQWv}};PH&w4i^s{(%E-vd*i_rVz{ jRc?MtW?ChKk%5u1uAz~xp+$%xiiX6DN diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png index 569dc4d6b0bcfa4441e6b790852c580893757b7e..5d461666a9551de859cf366adcc85e9d44cbfafd 100644 GIT binary patch delta 62 zcmaDM`9gBS1a=-37WP;AAseSZHRMEtYhaYACk1a=-37WP;AAseT=atj(+8Jk%dm}naqSQ!}jCLKwf{FYk*Rn*45=I&%U G9xVVw3K6sb delta 62 zcmX>haYACk1a@vQWv}};PH&v<$}MPUWn^S!Y^rTwU}az+V0znW@>^~NRMEtYiU85vm_n`#>vSQ!`ynBI1pyjn^DRWvap`QPL_ GQd$6E^%EKZ diff --git a/lib/presentation/additional_information_screen/additional_information_screen.dart b/lib/presentation/additional_information_screen/additional_information_screen.dart index 4f1b71e3..29ee4d52 100644 --- a/lib/presentation/additional_information_screen/additional_information_screen.dart +++ b/lib/presentation/additional_information_screen/additional_information_screen.dart @@ -44,7 +44,11 @@ class AdditionalInformationScreen extends StatelessWidget { SizedBox(height: 73.v), _buildNinetyThree(context), Spacer(), - CustomOutlinedButton(text: "lbl2".tr.toUpperCase()), + CustomOutlinedButton( + text: "lbl2".tr.toUpperCase(), + onPressed: () { + showSuccessMessage(context); + }), SizedBox(height: 17.v), Text("lbl3".tr, style: theme.textTheme.bodyLarge) ])))); @@ -119,4 +123,23 @@ class AdditionalInformationScreen extends StatelessWidget { onTapArrowLeft(BuildContext context) { NavigatorService.goBack(); } + + /// Displays an alert dialog when the action is triggered. + /// The dialog box contains a title and a message with the `Теперь вы можете пользоваться полным функционалом приложения` + showSuccessMessage(BuildContext context) { + showDialog( + context: context, + builder: (_) => AlertDialog( + title: const Text('Регистрация завершена!'), + content: const Text( + 'Теперь вы можете пользоваться полным функционалом приложения'), + actions: [ + TextButton( + onPressed: () { + Navigator.pop(context); + }, + child: const Text('Ok')) + ], + )); + } } diff --git a/lib/presentation/allergies_screen/allergies_screen.dart b/lib/presentation/allergies_screen/allergies_screen.dart index bb1f4d5e..7a2c3cdf 100644 --- a/lib/presentation/allergies_screen/allergies_screen.dart +++ b/lib/presentation/allergies_screen/allergies_screen.dart @@ -51,7 +51,11 @@ class AllergiesScreen extends StatelessWidget { Spacer(flex: 36), _buildNinetyThree(context), Spacer(flex: 63), - CustomOutlinedButton(text: "lbl2".tr.toUpperCase()), + CustomOutlinedButton( + text: "lbl2".tr.toUpperCase(), + onPressed: () { + navigateToMedicine(context); + }), SizedBox(height: 17.v), Text("lbl3".tr, style: theme.textTheme.bodyLarge) ])))); @@ -92,4 +96,11 @@ class AllergiesScreen extends StatelessWidget { onTapArrowLeft(BuildContext context) { NavigatorService.goBack(); } + + /// Navigates to the medicineIntakeScreen when the action is triggered. + navigateToMedicine(BuildContext context) { + NavigatorService.pushNamed( + AppRoutes.medicineIntakeScreen, + ); + } } diff --git a/lib/presentation/blood_pressure_screen/blood_pressure_screen.dart b/lib/presentation/blood_pressure_screen/blood_pressure_screen.dart index 5dcd2740..ba95be5b 100644 --- a/lib/presentation/blood_pressure_screen/blood_pressure_screen.dart +++ b/lib/presentation/blood_pressure_screen/blood_pressure_screen.dart @@ -107,7 +107,10 @@ class BloodPressureScreen extends StatelessWidget { Spacer(), CustomOutlinedButton( text: "lbl2".tr.toUpperCase(), - margin: EdgeInsets.symmetric(horizontal: 4.h)), + margin: EdgeInsets.symmetric(horizontal: 4.h), + onPressed: () { + navigateToSports(context); + }), SizedBox(height: 17.v), Text("lbl3".tr, style: theme.textTheme.bodyLarge) ])))); @@ -149,4 +152,11 @@ class BloodPressureScreen extends StatelessWidget { onTapArrowLeft(BuildContext context) { NavigatorService.goBack(); } + + /// Navigates to the favoriteSportsScreen when the action is triggered. + navigateToSports(BuildContext context) { + NavigatorService.pushNamed( + AppRoutes.favoriteSportsScreen, + ); + } } diff --git a/lib/presentation/body_circumferences_screen/body_circumferences_screen.dart b/lib/presentation/body_circumferences_screen/body_circumferences_screen.dart index 9d4d775b..aa980fda 100644 --- a/lib/presentation/body_circumferences_screen/body_circumferences_screen.dart +++ b/lib/presentation/body_circumferences_screen/body_circumferences_screen.dart @@ -74,7 +74,11 @@ class BodyCircumferencesScreen extends StatelessWidget { textInputAction: TextInputAction.done); }), Spacer(), - CustomOutlinedButton(text: "lbl2".tr.toUpperCase()), + CustomOutlinedButton( + text: "lbl2".tr.toUpperCase(), + onPressed: () { + navigateToWeight(context); + }), SizedBox(height: 17.v), Text("lbl3".tr, style: theme.textTheme.bodyLarge) ])))); @@ -113,4 +117,11 @@ class BodyCircumferencesScreen extends StatelessWidget { onTapArrowLeft(BuildContext context) { NavigatorService.goBack(); } + + /// Navigates to the weightScreen when the action is triggered. + navigateToWeight(BuildContext context) { + NavigatorService.pushNamed( + AppRoutes.weightScreen, + ); + } } diff --git a/lib/presentation/city_of_living_screen/city_of_living_screen.dart b/lib/presentation/city_of_living_screen/city_of_living_screen.dart index 6b37c010..800f4c8f 100644 --- a/lib/presentation/city_of_living_screen/city_of_living_screen.dart +++ b/lib/presentation/city_of_living_screen/city_of_living_screen.dart @@ -99,7 +99,11 @@ class CityOfLivingScreen extends StatelessWidget { }); }), Spacer(flex: 65), - CustomOutlinedButton(text: "lbl2".tr.toUpperCase()), + CustomOutlinedButton( + text: "lbl2".tr.toUpperCase(), + onPressed: () { + navigateToCircumferences(context); + }), SizedBox(height: 17.v), Text("lbl3".tr, style: theme.textTheme.bodyLarge) ])))); @@ -123,4 +127,11 @@ class CityOfLivingScreen extends StatelessWidget { onTapArrowLeft(BuildContext context) { NavigatorService.goBack(); } + + /// Navigates to the bodyCircumferencesScreen when the action is triggered. + navigateToCircumferences(BuildContext context) { + NavigatorService.pushNamed( + AppRoutes.bodyCircumferencesScreen, + ); + } } diff --git a/lib/presentation/date_of_birth_screen/date_of_birth_screen.dart b/lib/presentation/date_of_birth_screen/date_of_birth_screen.dart index 3e109d6a..b60c29c0 100644 --- a/lib/presentation/date_of_birth_screen/date_of_birth_screen.dart +++ b/lib/presentation/date_of_birth_screen/date_of_birth_screen.dart @@ -38,7 +38,11 @@ class DateOfBirthScreen extends StatelessWidget { Spacer(flex: 39), _buildDateInput(context), Spacer(flex: 60), - CustomOutlinedButton(text: "lbl2".tr.toUpperCase()), + CustomOutlinedButton( + text: "lbl2".tr.toUpperCase(), + onPressed: () { + navigateToCity(context); + }), SizedBox(height: 17.v), Align( alignment: Alignment.centerLeft, @@ -101,8 +105,12 @@ class DateOfBirthScreen extends StatelessWidget { SizedBox(height: 6.v), Align( alignment: Alignment.center, - child: Text("lbl_01_01_2000".tr, - style: theme.textTheme.titleMedium)), + child: GestureDetector( + onTap: () { + openDatePickerDialog(context); + }, + child: Text("lbl_01_01_2000".tr, + style: theme.textTheme.titleMedium))), SizedBox(height: 4.v) ])); } @@ -111,4 +119,24 @@ class DateOfBirthScreen extends StatelessWidget { onTapArrowLeft(BuildContext context) { NavigatorService.goBack(); } + + /// Displays a date picker dialog to update the selected date + /// + /// This function returns a `Future` that completes with `void`. + Future openDatePickerDialog(BuildContext context) async { + var initialState = BlocProvider.of(context).state; + DateTime? dateTime = await showDatePicker( + context: context, + initialDate: DateTime.now(), + firstDate: DateTime(1970), + lastDate: DateTime( + DateTime.now().year, DateTime.now().month, DateTime.now().day)); + } + + /// Navigates to the cityOfLivingScreen when the action is triggered. + navigateToCity(BuildContext context) { + NavigatorService.pushNamed( + AppRoutes.cityOfLivingScreen, + ); + } } diff --git a/lib/presentation/favorite_foods_screen/favorite_foods_screen.dart b/lib/presentation/favorite_foods_screen/favorite_foods_screen.dart index c5f5e27a..095819f1 100644 --- a/lib/presentation/favorite_foods_screen/favorite_foods_screen.dart +++ b/lib/presentation/favorite_foods_screen/favorite_foods_screen.dart @@ -46,7 +46,11 @@ class FavoriteFoodsScreen extends StatelessWidget { SizedBox(height: 22.v), _buildNinetyThree1(context), SizedBox(height: 27.v), - CustomOutlinedButton(text: "lbl2".tr.toUpperCase()), + CustomOutlinedButton( + text: "lbl2".tr.toUpperCase(), + onPressed: () { + navigateToSchedule(context); + }), SizedBox(height: 17.v), Text("lbl3".tr, style: theme.textTheme.bodyLarge) ])))); @@ -122,4 +126,11 @@ class FavoriteFoodsScreen extends StatelessWidget { onTapArrowLeft(BuildContext context) { NavigatorService.goBack(); } + + /// Navigates to the scheduleScreen when the action is triggered. + navigateToSchedule(BuildContext context) { + NavigatorService.pushNamed( + AppRoutes.scheduleScreen, + ); + } } diff --git a/lib/presentation/favorite_sports_screen/bloc/favorite_sports_bloc.dart b/lib/presentation/favorite_sports_screen/bloc/favorite_sports_bloc.dart index 9a7c8925..e90bfcf3 100644 --- a/lib/presentation/favorite_sports_screen/bloc/favorite_sports_bloc.dart +++ b/lib/presentation/favorite_sports_screen/bloc/favorite_sports_bloc.dart @@ -16,8 +16,6 @@ class FavoriteSportsBloc FavoriteSportsInitialEvent event, Emitter emit, ) async { - emit(state.copyWith( - enterinformationController: TextEditingController(), - )); + emit(state.copyWith(enterinformationController: TextEditingController())); } } diff --git a/lib/presentation/favorite_sports_screen/favorite_sports_screen.dart b/lib/presentation/favorite_sports_screen/favorite_sports_screen.dart index adcde32f..c665f625 100644 --- a/lib/presentation/favorite_sports_screen/favorite_sports_screen.dart +++ b/lib/presentation/favorite_sports_screen/favorite_sports_screen.dart @@ -6,122 +6,89 @@ import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; class FavoriteSportsScreen extends StatelessWidget { - const FavoriteSportsScreen({Key? key}) - : super( - key: key, - ); + const FavoriteSportsScreen({Key? key}) : super(key: key); static Widget builder(BuildContext context) { return BlocProvider( - create: (context) => FavoriteSportsBloc(FavoriteSportsState( - favoriteSportsModelObj: FavoriteSportsModel(), - )) - ..add(FavoriteSportsInitialEvent()), - child: FavoriteSportsScreen(), - ); + create: (context) => FavoriteSportsBloc( + FavoriteSportsState(favoriteSportsModelObj: FavoriteSportsModel())) + ..add(FavoriteSportsInitialEvent()), + child: FavoriteSportsScreen()); } @override Widget build(BuildContext context) { mediaQueryData = MediaQuery.of(context); - return SafeArea( - child: Scaffold( - resizeToAvoidBottomInset: false, - body: Container( - width: double.maxFinite, - padding: EdgeInsets.symmetric( - horizontal: 16.h, - vertical: 5.v, - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - CustomImageView( - imagePath: ImageConstant.imgLogoEatvio, - height: 50.adaptSize, - width: 50.adaptSize, - ), - SizedBox(height: 20.v), - _buildProgressIndicatorSection(context), - SizedBox(height: 38.v), - Text( - "msg11".tr, - style: theme.textTheme.headlineSmall, - ), - Spacer( - flex: 32, - ), - _buildNinetyThreeSection(context), - Spacer( - flex: 67, - ), - CustomOutlinedButton( - text: "lbl2".tr.toUpperCase(), - ), - SizedBox(height: 17.v), - Text( - "lbl3".tr, - style: theme.textTheme.bodyLarge, - ), - SizedBox(height: 4.v), - ], - ), - ), - ), - ); + child: Scaffold( + resizeToAvoidBottomInset: false, + body: Container( + width: double.maxFinite, + padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 5.v), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + CustomImageView( + imagePath: ImageConstant.imgLogoEatvio, + height: 50.adaptSize, + width: 50.adaptSize), + SizedBox(height: 20.v), + _buildProgressIndicatorSection(context), + SizedBox(height: 38.v), + Text("msg11".tr, style: theme.textTheme.headlineSmall), + Spacer(flex: 32), + _buildNinetyThreeSection(context), + Spacer(flex: 67), + CustomOutlinedButton( + text: "lbl2".tr.toUpperCase(), + onPressed: () { + navigateToFoods(context); + }), + SizedBox(height: 17.v), + Text("lbl3".tr, style: theme.textTheme.bodyLarge), + SizedBox(height: 4.v) + ])))); } /// Section Widget Widget _buildProgressIndicatorSection(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: 259.h, - decoration: BoxDecoration( - color: appTheme.blueA400, - borderRadius: BorderRadius.circular( - 4.h, - ), - border: Border.all( - color: theme.colorScheme.primary, - width: 1.h, - ), - ), - ), - ); + 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: 259.h, + decoration: BoxDecoration( + color: appTheme.blueA400, + borderRadius: BorderRadius.circular(4.h), + border: + Border.all(color: theme.colorScheme.primary, width: 1.h)))); } /// Section Widget Widget _buildNinetyThreeSection(BuildContext context) { - return Column( - children: [ - Text( - "msg4".tr, - style: CustomTextStyles.titleMediumSegoeUI, - ), - SizedBox(height: 2.v), - BlocSelector( + return Column(children: [ + Text("msg4".tr, style: CustomTextStyles.titleMediumSegoeUI), + SizedBox(height: 2.v), + BlocSelector( selector: (state) => state.enterinformationController, builder: (context, enterinformationController) { return CustomTextFormField( - controller: enterinformationController, - hintText: "msg5".tr, - textInputAction: TextInputAction.done, - maxLines: 8, - ); - }, - ), - ], + controller: enterinformationController, + hintText: "msg5".tr, + textInputAction: TextInputAction.done, + maxLines: 8); + }) + ]); + } + + /// Navigates to the favoriteFoodsScreen when the action is triggered. + navigateToFoods(BuildContext context) { + NavigatorService.pushNamed( + AppRoutes.favoriteFoodsScreen, ); } } diff --git a/lib/presentation/gender_screen/gender_screen.dart b/lib/presentation/gender_screen/gender_screen.dart index cc60c175..df73a593 100644 --- a/lib/presentation/gender_screen/gender_screen.dart +++ b/lib/presentation/gender_screen/gender_screen.dart @@ -39,7 +39,11 @@ class GenderScreen extends StatelessWidget { SizedBox(height: 20.v), Text(""), Spacer(flex: 66), - CustomOutlinedButton(text: "lbl2".tr.toUpperCase()), + CustomOutlinedButton( + text: "lbl2".tr.toUpperCase(), + onPressed: () { + navigateToDate(context); + }), SizedBox(height: 17.v), Text("lbl3".tr, style: theme.textTheme.bodyLarge) ])))); @@ -81,4 +85,11 @@ class GenderScreen extends StatelessWidget { onTapArrowLeft(BuildContext context) { NavigatorService.goBack(); } + + /// Navigates to the dateOfBirthScreen when the action is triggered. + navigateToDate(BuildContext context) { + NavigatorService.pushNamed( + AppRoutes.dateOfBirthScreen, + ); + } } diff --git a/lib/presentation/language_select_screen/bloc/language_select_bloc.dart b/lib/presentation/language_select_screen/bloc/language_select_bloc.dart index 2c3918c4..20e6503a 100644 --- a/lib/presentation/language_select_screen/bloc/language_select_bloc.dart +++ b/lib/presentation/language_select_screen/bloc/language_select_bloc.dart @@ -18,35 +18,22 @@ class LanguageSelectBloc Emitter emit, ) async { emit(state.copyWith( - languageSelectModelObj: state.languageSelectModelObj?.copyWith( - dropdownItemList: fillDropdownItemList(), - ))); + languageSelectModelObj: state.languageSelectModelObj + ?.copyWith(dropdownItemList: fillDropdownItemList()))); } _changeDropDown( ChangeDropDownEvent event, Emitter emit, ) { - emit(state.copyWith( - selectedDropDownValue: event.value, - )); + emit(state.copyWith(selectedDropDownValue: event.value)); } List fillDropdownItemList() { return [ - SelectionPopupModel( - id: 1, - title: "Item One", - isSelected: true, - ), - SelectionPopupModel( - id: 2, - title: "Item Two", - ), - SelectionPopupModel( - id: 3, - title: "Item Three", - ) + SelectionPopupModel(id: 1, title: "Item One", isSelected: true), + SelectionPopupModel(id: 2, title: "Item Two"), + SelectionPopupModel(id: 3, title: "Item Three") ]; } } diff --git a/lib/presentation/language_select_screen/language_select_screen.dart b/lib/presentation/language_select_screen/language_select_screen.dart index 677fbfcb..ce92f3ec 100644 --- a/lib/presentation/language_select_screen/language_select_screen.dart +++ b/lib/presentation/language_select_screen/language_select_screen.dart @@ -6,137 +6,101 @@ import 'package:eatvio_app/widgets/custom_outlined_button.dart'; import 'package:flutter/material.dart'; class LanguageSelectScreen extends StatelessWidget { - const LanguageSelectScreen({Key? key}) - : super( - key: key, - ); + const LanguageSelectScreen({Key? key}) : super(key: key); static Widget builder(BuildContext context) { return BlocProvider( - create: (context) => LanguageSelectBloc(LanguageSelectState( - languageSelectModelObj: LanguageSelectModel(), - )) - ..add(LanguageSelectInitialEvent()), - child: LanguageSelectScreen(), - ); + create: (context) => LanguageSelectBloc( + LanguageSelectState(languageSelectModelObj: LanguageSelectModel())) + ..add(LanguageSelectInitialEvent()), + child: LanguageSelectScreen()); } @override Widget build(BuildContext context) { mediaQueryData = MediaQuery.of(context); - return SafeArea( - child: Scaffold( - body: Container( - width: double.maxFinite, - padding: EdgeInsets.symmetric( - horizontal: 16.h, - vertical: 5.v, - ), - child: Column( - children: [ - CustomImageView( - imagePath: ImageConstant.imgLogoEatvio, - height: 50.adaptSize, - width: 50.adaptSize, - ), - SizedBox(height: 20.v), - _buildProgressIndicatorSection(context), - SizedBox(height: 20.v), - Container( - width: 262.h, - margin: EdgeInsets.only( - left: 41.h, - right: 39.h, - ), - child: Text( - "msg17".tr, - maxLines: 2, - overflow: TextOverflow.ellipsis, - textAlign: TextAlign.center, - style: theme.textTheme.headlineSmall, - ), - ), - Spacer( - flex: 36, - ), - BlocSelector( - selector: (state) => state.languageSelectModelObj, - builder: (context, languageSelectModelObj) { - return CustomDropDown( - icon: Container( - margin: EdgeInsets.fromLTRB(30.h, 11.v, 17.h, 11.v), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular( - 1.h, - ), - ), - child: CustomImageView( - imagePath: ImageConstant.imgFavorite, - height: 12.adaptSize, - width: 12.adaptSize, - ), - ), - hintText: "lbl_english".tr, - items: languageSelectModelObj?.dropdownItemList ?? [], - onChanged: (value) { - context - .read() - .add(ChangeDropDownEvent(value: value)); - }, - ); - }, - ), - Spacer( - flex: 63, - ), - ], - ), - ), - bottomNavigationBar: _buildContinueButtonSection(context), - ), - ); + child: Scaffold( + body: Container( + width: double.maxFinite, + padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 5.v), + child: Column(children: [ + CustomImageView( + imagePath: ImageConstant.imgLogoEatvio, + height: 50.adaptSize, + width: 50.adaptSize), + SizedBox(height: 20.v), + _buildProgressIndicatorSection(context), + SizedBox(height: 20.v), + Container( + width: 262.h, + margin: EdgeInsets.only(left: 41.h, right: 39.h), + child: Text("msg17".tr, + maxLines: 2, + overflow: TextOverflow.ellipsis, + textAlign: TextAlign.center, + style: theme.textTheme.headlineSmall)), + Spacer(flex: 36), + BlocSelector( + selector: (state) => state.languageSelectModelObj, + builder: (context, languageSelectModelObj) { + return CustomDropDown( + icon: Container( + margin: + EdgeInsets.fromLTRB(30.h, 11.v, 17.h, 11.v), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(1.h)), + child: CustomImageView( + imagePath: ImageConstant.imgFavorite, + height: 12.adaptSize, + width: 12.adaptSize)), + hintText: "lbl_english".tr, + items: + languageSelectModelObj?.dropdownItemList ?? [], + onChanged: (value) { + context + .read() + .add(ChangeDropDownEvent(value: value)); + }); + }), + Spacer(flex: 63) + ])), + bottomNavigationBar: _buildContinueButtonSection(context))); } /// Section Widget Widget _buildProgressIndicatorSection(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: 20.h, - decoration: BoxDecoration( - color: appTheme.blueA400, - borderRadius: BorderRadius.circular( - 4.h, - ), - border: Border.all( - color: theme.colorScheme.primary, - width: 1.h, - ), - ), - ), - ); + 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: 20.h, + decoration: BoxDecoration( + color: appTheme.blueA400, + borderRadius: BorderRadius.circular(4.h), + border: + Border.all(color: theme.colorScheme.primary, width: 1.h)))); } /// Section Widget Widget _buildContinueButtonSection(BuildContext context) { return CustomOutlinedButton( - text: "lbl2".tr.toUpperCase(), - margin: EdgeInsets.only( - left: 16.h, - right: 16.h, - bottom: 50.v, - ), - buttonStyle: CustomButtonStyles.outlinePrimaryTL15, + text: "lbl2".tr.toUpperCase(), + margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v), + buttonStyle: CustomButtonStyles.outlinePrimaryTL15, + onPressed: () { + navigteToGender(context); + }); + } + + /// Navigates to the genderScreen when the action is triggered. + navigteToGender(BuildContext context) { + NavigatorService.pushNamed( + AppRoutes.genderScreen, ); } } diff --git a/lib/presentation/medicine_intake_screen/medicine_intake_screen.dart b/lib/presentation/medicine_intake_screen/medicine_intake_screen.dart index 56da2766..dbb66208 100644 --- a/lib/presentation/medicine_intake_screen/medicine_intake_screen.dart +++ b/lib/presentation/medicine_intake_screen/medicine_intake_screen.dart @@ -58,7 +58,11 @@ class MedicineIntakeScreen extends StatelessWidget { SizedBox(height: 86.v), _buildNinetyThree(context), Spacer(), - CustomOutlinedButton(text: "lbl2".tr.toUpperCase()), + CustomOutlinedButton( + text: "lbl2".tr.toUpperCase(), + onPressed: () { + navigateToPressure(context); + }), SizedBox(height: 17.v), Text("lbl3".tr, style: theme.textTheme.bodyLarge) ])))); @@ -100,4 +104,11 @@ class MedicineIntakeScreen extends StatelessWidget { onTapArrowLeft(BuildContext context) { NavigatorService.goBack(); } + + /// Navigates to the bloodPressureScreen when the action is triggered. + navigateToPressure(BuildContext context) { + NavigatorService.pushNamed( + AppRoutes.bloodPressureScreen, + ); + } } diff --git a/lib/presentation/schedule_screen/schedule_screen.dart b/lib/presentation/schedule_screen/schedule_screen.dart index b9e49d0d..827991fd 100644 --- a/lib/presentation/schedule_screen/schedule_screen.dart +++ b/lib/presentation/schedule_screen/schedule_screen.dart @@ -37,7 +37,11 @@ class ScheduleScreen extends StatelessWidget { SizedBox(height: 67.v), _buildNinetyThree(context), Spacer(), - CustomOutlinedButton(text: "lbl2".tr.toUpperCase()), + CustomOutlinedButton( + text: "lbl2".tr.toUpperCase(), + onPressed: () { + navigateToAdditional(context); + }), SizedBox(height: 17.v), Text("lbl3".tr, style: theme.textTheme.bodyLarge) ])))); @@ -102,4 +106,11 @@ class ScheduleScreen extends StatelessWidget { 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/presentation/weight_screen/weight_screen.dart b/lib/presentation/weight_screen/weight_screen.dart index bb3358ba..804f5812 100644 --- a/lib/presentation/weight_screen/weight_screen.dart +++ b/lib/presentation/weight_screen/weight_screen.dart @@ -48,7 +48,11 @@ class WeightScreen extends StatelessWidget { SizedBox(height: 39.v), _buildTwentySix(context), Spacer(), - CustomOutlinedButton(text: "lbl2".tr.toUpperCase()), + CustomOutlinedButton( + text: "lbl2".tr.toUpperCase(), + onPressed: () { + navigateToAllergies(context); + }), SizedBox(height: 17.v), Text("lbl3".tr, style: theme.textTheme.bodyLarge) ])))); @@ -109,4 +113,11 @@ class WeightScreen extends StatelessWidget { onTapArrowLeft(BuildContext context) { NavigatorService.goBack(); } + + /// Navigates to the allergiesScreen when the action is triggered. + navigateToAllergies(BuildContext context) { + NavigatorService.pushNamed( + AppRoutes.allergiesScreen, + ); + } }