From d38a7d5d6c7f086010c7dc4c032c44f3bcd09b6b Mon Sep 17 00:00:00 2001 From: maxxkim Date: Wed, 24 Jan 2024 18:47:06 +0300 Subject: [PATCH] Settings screen (no layouts) --- lib/localization/ru/ru_translations.dart | 6 ++ .../profile/my_profile_screen/admin.dart | 0 .../profile/my_profile_screen/my_blog.dart | 0 .../profile/my_profile_screen/my_diary.dart | 0 .../my_profile_screen/my_profile_screen.dart | 9 ++- .../my_profile_screen/my_settings_screen.dart | 67 +++++++++++++++++++ lib/routes/app_routes.dart | 4 ++ lib/widgets/custom_bottom_bar.dart | 12 ++-- 8 files changed, 89 insertions(+), 9 deletions(-) create mode 100644 lib/presentation/profile/my_profile_screen/admin.dart create mode 100644 lib/presentation/profile/my_profile_screen/my_blog.dart create mode 100644 lib/presentation/profile/my_profile_screen/my_diary.dart create mode 100644 lib/presentation/profile/my_profile_screen/my_settings_screen.dart diff --git a/lib/localization/ru/ru_translations.dart b/lib/localization/ru/ru_translations.dart index 338dbcb5..820010a4 100644 --- a/lib/localization/ru/ru_translations.dart +++ b/lib/localization/ru/ru_translations.dart @@ -123,4 +123,10 @@ final Map ru = { "in_progress": "В процессе", "add_measure": "Добавить замер", "weight": "Вес", + "plans_complete": "Пройденные планы", + "my_settings": "Мои настройки", + "profile": "Профиль", + "chat": "Чат", + "admin": "Админ", + "diary": "Дневник", }; diff --git a/lib/presentation/profile/my_profile_screen/admin.dart b/lib/presentation/profile/my_profile_screen/admin.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/presentation/profile/my_profile_screen/my_blog.dart b/lib/presentation/profile/my_profile_screen/my_blog.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/presentation/profile/my_profile_screen/my_diary.dart b/lib/presentation/profile/my_profile_screen/my_diary.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/presentation/profile/my_profile_screen/my_profile_screen.dart b/lib/presentation/profile/my_profile_screen/my_profile_screen.dart index 7af4f16a..2b2aa997 100644 --- a/lib/presentation/profile/my_profile_screen/my_profile_screen.dart +++ b/lib/presentation/profile/my_profile_screen/my_profile_screen.dart @@ -216,8 +216,11 @@ class MyProfileScreen extends StatelessWidget { Expanded( child: NextStepButton( buttonStyle: CustomButtonStyles.outlinePrimaryTL15, - text: "lbl4".tr.toUpperCase(), - margin: EdgeInsets.only(left: 10.h))) + onPressed: () { + Navigator.pushNamed(context, AppRoutes.mySettings); + }, + text: "my_settings".tr.toUpperCase(), + margin: EdgeInsets.only(left: 10.h))), ])); } @@ -641,7 +644,7 @@ class MyProfileScreen extends StatelessWidget { Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( padding: EdgeInsets.only(left: 15.h), - child: Text("msg".tr, + child: Text("plans_complete".tr, style: CustomTextStyles.titleSmallBluegray800)), SizedBox( height: 95.v, diff --git a/lib/presentation/profile/my_profile_screen/my_settings_screen.dart b/lib/presentation/profile/my_profile_screen/my_settings_screen.dart new file mode 100644 index 00000000..a6466b62 --- /dev/null +++ b/lib/presentation/profile/my_profile_screen/my_settings_screen.dart @@ -0,0 +1,67 @@ +import 'dart:ffi'; + +import 'bloc/my_profile_bloc.dart'; +import 'models/my_profile_model.dart'; +import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/widgets/app_bar/appbar_subtitle.dart'; +import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.dart'; +import 'package:eatvio_app/widgets/app_bar/custom_app_bar.dart'; +import 'package:eatvio_app/widgets/custom_bottom_bar.dart'; +import 'package:eatvio_app/widgets/custom_text_form_field.dart'; +import 'package:flutter/material.dart'; + +class MySettingsScreen extends StatelessWidget { + static Widget builder(BuildContext context) { + return BlocProvider( + create: (context) => + MyProfileBloc(MyProfileState(myProfileModelObj: MyProfileModel())) + ..add(MyProfileInitialEvent()), + child: MySettingsScreen()); + } + + @override + Widget build(BuildContext context) { + mediaQueryData = MediaQuery.of(context); + return BlocBuilder( + builder: (context, state) { + return SafeArea( + child: Scaffold( + appBar: _buildAppBar(context, "my_settings".tr), + body: Container( + width: double.maxFinite, + padding: + EdgeInsets.symmetric(horizontal: 8.h, vertical: 18.v), + child: Column(children: [])), + bottomNavigationBar: _buildBottomBar(context))); + }); + } + + /// Section Widget + PreferredSizeWidget _buildAppBar(BuildContext context, String username) { + return CustomAppBar( + height: 54.v, + leadingWidth: 28.h, + leading: AppbarLeadingImage( + imagePath: ImageConstant.imgArrowLeft, + margin: EdgeInsets.only(left: 16.h, top: 15.v, bottom: 15.v), + onTap: () { + onTapArrowLeft(context); + }), + title: Padding( + padding: EdgeInsets.only(left: 20.h), + child: Row(children: [ + AppbarSubtitle( + text: username, + margin: EdgeInsets.only(left: 80.h, top: 12.v, bottom: 9.v)) + ])), + ); + } + + Widget _buildBottomBar(BuildContext context) { + return CustomBottomBar(onChanged: (BottomBarEnum type) {}); + } + + onTapArrowLeft(BuildContext context) { + NavigatorService.goBack(); + } +} diff --git a/lib/routes/app_routes.dart b/lib/routes/app_routes.dart index 147c6b29..b83e7ff9 100644 --- a/lib/routes/app_routes.dart +++ b/lib/routes/app_routes.dart @@ -18,6 +18,7 @@ import 'package:eatvio_app/presentation/registration/name_screen/name_screen.dar import 'package:eatvio_app/presentation/registration/app_navigation_screen/app_navigation_screen.dart'; import 'package:eatvio_app/presentation/auth/auth_screen/auth_screen.dart'; import 'package:eatvio_app/presentation/profile/my_profile_screen/my_profile_screen.dart'; +import 'package:eatvio_app/presentation/profile/my_profile_screen/my_settings_screen.dart'; class AppRoutes { // REGISTRATION @@ -66,6 +67,8 @@ class AppRoutes { //PROFILE static const String myProfile = '/myProfile'; + static const String mySettings = '/mySettings'; + static Map get routes => { dateOfBirthScreen: DateOfBirthScreen.builder, cityOfLivingScreen: CityOfLivingScreen.builder, @@ -87,5 +90,6 @@ class AppRoutes { appNavigationScreen: AppNavigationScreen.builder, initialRoute: SplashScreen.builder, myProfile: MyProfileScreen.builder, + mySettings: MySettingsScreen.builder, }; } diff --git a/lib/widgets/custom_bottom_bar.dart b/lib/widgets/custom_bottom_bar.dart index 6304f2d5..67ae4e3f 100644 --- a/lib/widgets/custom_bottom_bar.dart +++ b/lib/widgets/custom_bottom_bar.dart @@ -11,37 +11,37 @@ class CustomBottomBar extends StatefulWidget { } class CustomBottomBarState extends State { - int selectedIndex = 0; + int selectedIndex = 2; List bottomMenuList = [ BottomMenuModel( icon: ImageConstant.imgNav, activeIcon: ImageConstant.imgNav, - title: "lbl17".tr, + title: "diary".tr, type: BottomBarEnum.tf, ), BottomMenuModel( icon: ImageConstant.imgNavBlueGray400, activeIcon: ImageConstant.imgNavBlueGray400, - title: "lbl18".tr, + title: "my_blog".tr, type: BottomBarEnum.tf, ), BottomMenuModel( icon: ImageConstant.imgNavBlueGray40024x23, activeIcon: ImageConstant.imgNavBlueGray40024x23, - title: "lbl19".tr, + title: "profile".tr, type: BottomBarEnum.tf, ), BottomMenuModel( icon: ImageConstant.imgNavPrimary, activeIcon: ImageConstant.imgNavPrimary, - title: "lbl20".tr, + title: "admin".tr, type: BottomBarEnum.tf, ), BottomMenuModel( icon: ImageConstant.imgNavBlueGray40024x25, activeIcon: ImageConstant.imgNavBlueGray40024x25, - title: "lbl21".tr, + title: "chat".tr, type: BottomBarEnum.tf, ) ];