From 795dc48629733b1d081058e468bc12936b335066 Mon Sep 17 00:00:00 2001 From: maxxkim Date: Mon, 3 Jun 2024 16:00:48 +0300 Subject: [PATCH] feat(app): SafeArea insets refactoring --- .DS_Store | Bin 8196 -> 8196 bytes lib/core/app_export.dart | 1 - .../chat_select_screen.dart | 9 ++--- .../diary_edit_screen/diary_edit_screen.dart | 9 ++--- .../diet_create_screen.dart | 11 +++--- .../diet_edit_screen/diet_edit_screen.dart | 11 +++--- .../diet_select_screen.dart | 8 ++-- .../diet_show_screen/diet_show_screen.dart | 8 ++-- .../blog_post_create_screen.dart | 9 ++--- .../blog_post_edit_screen.dart | 9 ++--- .../blog_post_screen/blog_post_screen.dart | 37 +++++++++--------- .../feed/feed_screen/feed_screen.dart | 10 ++--- .../plan_create_screen.dart | 9 ++--- .../plan_edit_screen/plan_edit_screen.dart | 11 +++--- .../plan_select_screen.dart | 10 ++--- .../plan_show_screen/plan_show_screen.dart | 8 ++-- .../bloc/my_profile_bloc.dart | 4 ++ .../my_profile_screen/my_profile_screen.dart | 14 +++---- .../my_profile_screen/my_settings_screen.dart | 10 ++--- .../recipe_create_screen.dart | 11 +++--- .../recipe_edit_screen.dart | 11 +++--- .../recipe_select_screen.dart | 10 ++--- .../recipe_show_screen.dart | 8 ++-- lib/routes/app_routes.dart | 2 + lib/widgets/app_bar/appbar_subtitle.dart | 5 --- lib/widgets/custom_bottom_bar.dart | 28 ++++++------- 26 files changed, 121 insertions(+), 142 deletions(-) diff --git a/.DS_Store b/.DS_Store index bad9d0d2c3d8feb19a94decc095769ce626a0d6a..506ab56a1bbab76b0cc160948fb2d34d83b3f3f7 100644 GIT binary patch delta 20 bcmZp1XmQx!D9CPVsiR*llyWU@ad2FmDA; diff --git a/lib/core/app_export.dart b/lib/core/app_export.dart index 6d115305..6c17ee13 100644 --- a/lib/core/app_export.dart +++ b/lib/core/app_export.dart @@ -1,4 +1,3 @@ -export 'package:connectivity_plus/connectivity_plus.dart'; export 'package:flutter_bloc/flutter_bloc.dart'; export 'package:eatvio_app/core/constants/constants.dart'; export 'package:eatvio_app/core/errors/exceptions.dart'; diff --git a/lib/presentation/chat/chat_select_screen/chat_select_screen.dart b/lib/presentation/chat/chat_select_screen/chat_select_screen.dart index dea9d3bc..6304ca29 100644 --- a/lib/presentation/chat/chat_select_screen/chat_select_screen.dart +++ b/lib/presentation/chat/chat_select_screen/chat_select_screen.dart @@ -41,15 +41,14 @@ class ChatSelectScreen extends StatelessWidget { _buildScreen(BuildContext context, ChatSelectLoadedState state) { mediaQueryData = MediaQuery.of(context); - return SafeArea( - child: Scaffold( + return Scaffold( resizeToAvoidBottomInset: false, - body: Container( + body: SafeArea( + child: Container( width: double.maxFinite, decoration: AppDecoration.fillGray, child: ListView( children: [ - SizedBox(height: 30.v), Container( margin: EdgeInsets.only( left: 16.h, @@ -84,7 +83,7 @@ class ChatSelectScreen extends StatelessWidget { ], ), ), - bottomNavigationBar: _buildBottomBar(context))); + ), bottomNavigationBar: _buildBottomBar(context)); } } diff --git a/lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart b/lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart index 1e81c626..0bef582e 100644 --- a/lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart +++ b/lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart @@ -61,11 +61,11 @@ class DiaryEditScreen extends StatelessWidget { child: Stack( children: [ FormBuilder( - child: SafeArea( - child: Scaffold( + child: Scaffold( backgroundColor: Color.fromARGB(255, 240, 242, 245), resizeToAvoidBottomInset: true, - body: SizedBox( + body: SafeArea( + child: SizedBox( width: double.maxFinite, child: Column( children: [ @@ -94,9 +94,8 @@ class DiaryEditScreen extends StatelessWidget { ], ), ), - bottomNavigationBar: _buildBottomBar(context), ), - ), + bottomNavigationBar: _buildBottomBar(context) ), ), Positioned( left: 16.h, diff --git a/lib/presentation/diets/diet_create_screen/diet_create_screen.dart b/lib/presentation/diets/diet_create_screen/diet_create_screen.dart index 6896701c..0ba49889 100644 --- a/lib/presentation/diets/diet_create_screen/diet_create_screen.dart +++ b/lib/presentation/diets/diet_create_screen/diet_create_screen.dart @@ -39,14 +39,13 @@ class DietCreateScreen extends StatelessWidget { _buildDietCreate(BuildContext context, DietCreateLoadedState state) { mediaQueryData = MediaQuery.of(context); - return SafeArea( - child: Scaffold( + return Scaffold( resizeToAvoidBottomInset: false, - body: Container( + body: SafeArea( + child: Container( width: double.maxFinite, decoration: AppDecoration.fillGray, - child: ListView(children: [ - SizedBox(height: 30.v), + child: ListView(children: [ Container( margin: EdgeInsets.only( left: 16.h, @@ -88,7 +87,7 @@ class DietCreateScreen extends StatelessWidget { ) ]), ), - bottomNavigationBar: _buildBottomBar(context))); + ), bottomNavigationBar: _buildBottomBar(context)); } } diff --git a/lib/presentation/diets/diet_edit_screen/diet_edit_screen.dart b/lib/presentation/diets/diet_edit_screen/diet_edit_screen.dart index 75f02810..0a9ef1c9 100644 --- a/lib/presentation/diets/diet_edit_screen/diet_edit_screen.dart +++ b/lib/presentation/diets/diet_edit_screen/diet_edit_screen.dart @@ -41,14 +41,13 @@ class DietEditScreen extends StatelessWidget { _buildDietEdit(BuildContext context, DietEditLoadedState state) { mediaQueryData = MediaQuery.of(context); - return SafeArea( - child: Scaffold( + return Scaffold( resizeToAvoidBottomInset: false, - body: Container( + body: SafeArea( + child: Container( width: double.maxFinite, decoration: AppDecoration.fillGray, - child: ListView(children: [ - SizedBox(height: 30.v), + child: ListView(children: [ Container( margin: EdgeInsets.only( left: 16.h, @@ -105,7 +104,7 @@ class DietEditScreen extends StatelessWidget { ) ]), ), - bottomNavigationBar: _buildBottomBar(context))); + ), bottomNavigationBar: _buildBottomBar(context)); } } diff --git a/lib/presentation/diets/diet_select_screen/diet_select_screen.dart b/lib/presentation/diets/diet_select_screen/diet_select_screen.dart index c44308d8..38670d37 100644 --- a/lib/presentation/diets/diet_select_screen/diet_select_screen.dart +++ b/lib/presentation/diets/diet_select_screen/diet_select_screen.dart @@ -40,11 +40,11 @@ class DietSelectScreen extends StatelessWidget { _buildSetingsScreen(BuildContext context, DietSelectLoadedState state) { mediaQueryData = MediaQuery.of(context); - return SafeArea( - child: Scaffold( + return Scaffold( backgroundColor: Colors.grey[200], resizeToAvoidBottomInset: true, - body: SingleChildScrollView( + body: SafeArea( + child: SingleChildScrollView( child: Container( width: double.maxFinite, decoration: BoxDecoration(color: Colors.grey[200]), @@ -107,8 +107,8 @@ class DietSelectScreen extends StatelessWidget { ), ), ), - bottomNavigationBar: _buildBottomBar(context), ), + bottomNavigationBar: _buildBottomBar(context), ); } diff --git a/lib/presentation/diets/diet_show_screen/diet_show_screen.dart b/lib/presentation/diets/diet_show_screen/diet_show_screen.dart index dcc20aea..5922a358 100644 --- a/lib/presentation/diets/diet_show_screen/diet_show_screen.dart +++ b/lib/presentation/diets/diet_show_screen/diet_show_screen.dart @@ -41,10 +41,10 @@ class DietScreen extends StatelessWidget { _buildDiet(BuildContext context, DietLoadedState state) { mediaQueryData = MediaQuery.of(context); - return SafeArea( - child: Scaffold( + return Scaffold( resizeToAvoidBottomInset: false, - body: Container( + body: SafeArea( + child: Container( width: double.maxFinite, decoration: AppDecoration.fillGray, child: ListView( @@ -117,7 +117,7 @@ class DietScreen extends StatelessWidget { ], ), ), - bottomNavigationBar: _buildBottomBar(context))); + ), bottomNavigationBar: _buildBottomBar(context)); } ///Handling route based on bottom click actions diff --git a/lib/presentation/feed/blog_post_create_screen/blog_post_create_screen.dart b/lib/presentation/feed/blog_post_create_screen/blog_post_create_screen.dart index 6950af55..c1c5514a 100644 --- a/lib/presentation/feed/blog_post_create_screen/blog_post_create_screen.dart +++ b/lib/presentation/feed/blog_post_create_screen/blog_post_create_screen.dart @@ -40,14 +40,13 @@ class BlogPostCreateScreen extends StatelessWidget { _buildBlogPostCreate(BuildContext context, BlogPostCreateLoadedState state) { mediaQueryData = MediaQuery.of(context); - return SafeArea( - child: Scaffold( + return Scaffold( resizeToAvoidBottomInset: false, - body: Container( + body: SafeArea( + child: Container( width: double.maxFinite, decoration: AppDecoration.fillGray, child: ListView(children: [ - SizedBox(height: 30.v), Container( margin: EdgeInsets.only( left: 16.h, @@ -95,7 +94,7 @@ class BlogPostCreateScreen extends StatelessWidget { ) ]), ), - bottomNavigationBar: _buildBottomBar(context))); + ), bottomNavigationBar: _buildBottomBar(context)); } } diff --git a/lib/presentation/feed/blog_post_edit_screen/blog_post_edit_screen.dart b/lib/presentation/feed/blog_post_edit_screen/blog_post_edit_screen.dart index 1bba76d6..20988195 100644 --- a/lib/presentation/feed/blog_post_edit_screen/blog_post_edit_screen.dart +++ b/lib/presentation/feed/blog_post_edit_screen/blog_post_edit_screen.dart @@ -42,14 +42,13 @@ class BlogPostEditScreen extends StatelessWidget { _buildBlogPostEdit(BuildContext context, BlogPostEditLoadedState state) { mediaQueryData = MediaQuery.of(context); - return SafeArea( - child: Scaffold( + return Scaffold( resizeToAvoidBottomInset: false, - body: Container( + body: SafeArea( + child: Container( width: double.maxFinite, decoration: AppDecoration.fillGray, child: ListView(children: [ - SizedBox(height: 30.v), Container( margin: EdgeInsets.only( left: 16.h, @@ -111,7 +110,7 @@ class BlogPostEditScreen extends StatelessWidget { ) ]), ), - bottomNavigationBar: _buildBottomBar(context))); + ), bottomNavigationBar: _buildBottomBar(context)); } } diff --git a/lib/presentation/feed/blog_post_screen/blog_post_screen.dart b/lib/presentation/feed/blog_post_screen/blog_post_screen.dart index 04637420..c974e81f 100644 --- a/lib/presentation/feed/blog_post_screen/blog_post_screen.dart +++ b/lib/presentation/feed/blog_post_screen/blog_post_screen.dart @@ -46,26 +46,25 @@ class BlogPostScreen extends StatelessWidget { _buildBlogPost(BuildContext context, BlogPostLoadedState state) { mediaQueryData = MediaQuery.of(context); - return SafeArea( - child: Scaffold( + return Scaffold( resizeToAvoidBottomInset: false, - body: Container( - width: double.maxFinite, - decoration: AppDecoration.fillGray, - child: ListView( - children: [ - SizedBox(height: 15.v), - _buildHeaderRow(context, state), - SizedBox(height: 15.v), - _buildBlogPostData(context, state), - SizedBox(height: 15.v), - _buildTextField(context, state), - SizedBox(height: 15.v), - _buildCommentSection(context, state), - ], - ), - ), - bottomNavigationBar: _buildBottomBar(context))); + body: SafeArea( + child: Container( + width: double.maxFinite, + decoration: AppDecoration.fillGray, + child: ListView( + children: [ + _buildHeaderRow(context, state), + SizedBox(height: 15.v), + _buildBlogPostData(context, state), + SizedBox(height: 15.v), + _buildTextField(context, state), + SizedBox(height: 15.v), + _buildCommentSection(context, state), + ], + ), + ), + ),bottomNavigationBar: _buildBottomBar(context)); } _buildHeaderRow(BuildContext context, BlogPostLoadedState state) { diff --git a/lib/presentation/feed/feed_screen/feed_screen.dart b/lib/presentation/feed/feed_screen/feed_screen.dart index a7cd48fe..fdeff779 100644 --- a/lib/presentation/feed/feed_screen/feed_screen.dart +++ b/lib/presentation/feed/feed_screen/feed_screen.dart @@ -40,11 +40,11 @@ class FeedScreen extends StatelessWidget { _buildFeedScreen(BuildContext context, FeedLoadedState state) { mediaQueryData = MediaQuery.of(context); - return SafeArea( - child: Scaffold( + return Scaffold( backgroundColor: Colors.grey[200], resizeToAvoidBottomInset: true, - body: SingleChildScrollView( + body: SafeArea( + child: SingleChildScrollView( child: Container( width: double.maxFinite, decoration: BoxDecoration(color: Colors.grey[200]), @@ -53,7 +53,6 @@ class FeedScreen extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - SizedBox(height: 20), _buildSearch(), SizedBox(height: 20), _buildMenu(context, state), @@ -64,9 +63,8 @@ class FeedScreen extends StatelessWidget { ), ), ), - bottomNavigationBar: _buildBottomBar(context), ), - ); + bottomNavigationBar: _buildBottomBar(context),); } _buildSearch() { diff --git a/lib/presentation/plans/plan_create_screen/plan_create_screen.dart b/lib/presentation/plans/plan_create_screen/plan_create_screen.dart index af04abc7..bc871c62 100644 --- a/lib/presentation/plans/plan_create_screen/plan_create_screen.dart +++ b/lib/presentation/plans/plan_create_screen/plan_create_screen.dart @@ -39,14 +39,13 @@ class PlanCreateScreen extends StatelessWidget { _buildPlanCreate(BuildContext context, PlanCreateLoadedState state) { mediaQueryData = MediaQuery.of(context); - return SafeArea( - child: Scaffold( + return Scaffold( resizeToAvoidBottomInset: false, - body: Container( + body: SafeArea( + child: Container( width: double.maxFinite, decoration: AppDecoration.fillGray, child: ListView(children: [ - SizedBox(height: 30.v), Container( margin: EdgeInsets.only( left: 16.h, @@ -88,7 +87,7 @@ class PlanCreateScreen extends StatelessWidget { ) ]), ), - bottomNavigationBar: _buildBottomBar(context))); + ), bottomNavigationBar: _buildBottomBar(context)); } } diff --git a/lib/presentation/plans/plan_edit_screen/plan_edit_screen.dart b/lib/presentation/plans/plan_edit_screen/plan_edit_screen.dart index 71ac12b7..b4cef923 100644 --- a/lib/presentation/plans/plan_edit_screen/plan_edit_screen.dart +++ b/lib/presentation/plans/plan_edit_screen/plan_edit_screen.dart @@ -41,14 +41,13 @@ class PlanEditScreen extends StatelessWidget { _buildPlanEdit(BuildContext context, PlanEditLoadedState state) { mediaQueryData = MediaQuery.of(context); - return SafeArea( - child: Scaffold( + return Scaffold( resizeToAvoidBottomInset: false, - body: Container( + body: SafeArea( + child: Container( width: double.maxFinite, decoration: AppDecoration.fillGray, - child: ListView(children: [ - SizedBox(height: 30.v), + child: ListView(children: [ Container( margin: EdgeInsets.only( left: 16.h, @@ -105,7 +104,7 @@ class PlanEditScreen extends StatelessWidget { ) ]), ), - bottomNavigationBar: _buildBottomBar(context))); + ), bottomNavigationBar: _buildBottomBar(context)); } } diff --git a/lib/presentation/plans/plan_select_screen/plan_select_screen.dart b/lib/presentation/plans/plan_select_screen/plan_select_screen.dart index 7f3486a2..586f6a5e 100644 --- a/lib/presentation/plans/plan_select_screen/plan_select_screen.dart +++ b/lib/presentation/plans/plan_select_screen/plan_select_screen.dart @@ -40,11 +40,11 @@ class PlanSelectScreen extends StatelessWidget { _buildSetingsScreen(BuildContext context, PlanSelectLoadedState state) { mediaQueryData = MediaQuery.of(context); - return SafeArea( - child: Scaffold( + return Scaffold( backgroundColor: Colors.grey[200], resizeToAvoidBottomInset: true, - body: SingleChildScrollView( + body: SafeArea( + child: SingleChildScrollView( child: Container( width: double.maxFinite, decoration: BoxDecoration(color: Colors.grey[200]), @@ -106,9 +106,9 @@ class PlanSelectScreen extends StatelessWidget { ), ), ), - ), - bottomNavigationBar: _buildBottomBar(context), + ), ), + bottomNavigationBar: _buildBottomBar(context), ); } diff --git a/lib/presentation/plans/plan_show_screen/plan_show_screen.dart b/lib/presentation/plans/plan_show_screen/plan_show_screen.dart index d34e1a43..eb91c2b8 100644 --- a/lib/presentation/plans/plan_show_screen/plan_show_screen.dart +++ b/lib/presentation/plans/plan_show_screen/plan_show_screen.dart @@ -41,10 +41,10 @@ class PlanScreen extends StatelessWidget { _buildPlan(BuildContext context, PlanLoadedState state) { mediaQueryData = MediaQuery.of(context); - return SafeArea( - child: Scaffold( + return Scaffold( resizeToAvoidBottomInset: false, - body: Container( + body: SafeArea( + child: Container( width: double.maxFinite, decoration: AppDecoration.fillGray, child: ListView( @@ -115,7 +115,7 @@ class PlanScreen extends StatelessWidget { ], ), ), - bottomNavigationBar: _buildBottomBar(context))); + ), bottomNavigationBar: _buildBottomBar(context)); } diff --git a/lib/presentation/profile/my_profile_screen/bloc/my_profile_bloc.dart b/lib/presentation/profile/my_profile_screen/bloc/my_profile_bloc.dart index b0359fd1..baf7cdcd 100644 --- a/lib/presentation/profile/my_profile_screen/bloc/my_profile_bloc.dart +++ b/lib/presentation/profile/my_profile_screen/bloc/my_profile_bloc.dart @@ -48,6 +48,10 @@ class MyProfileBloc extends Bloc { data.containsKey('userDetails') && data.containsKey('chartPoints') && data.containsKey('circumferences')) { + final avatarBox = await Hive.openBox('avatar'); + final avatar = data['user']['profile_photo_path']; + print(avatar); + avatarBox.put('avatar', avatar); if (state is MyProfileLoadedState) { var currentState = state as MyProfileLoadedState; var plans = [] 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 5d1f9bf3..08c3a9c5 100644 --- a/lib/presentation/profile/my_profile_screen/my_profile_screen.dart +++ b/lib/presentation/profile/my_profile_screen/my_profile_screen.dart @@ -50,18 +50,17 @@ class MyProfileScreen extends StatelessWidget { _buildMyProfileScreen(BuildContext context, MyProfileLoadedState state) { mediaQueryData = MediaQuery.of(context); - return SafeArea( - child: Scaffold( + return Scaffold( backgroundColor: Colors.grey[200], resizeToAvoidBottomInset: true, - body: SingleChildScrollView( + body: SafeArea( + child: SingleChildScrollView( child: Container( width: double.maxFinite, decoration: BoxDecoration(color: Colors.grey[200]), child: Padding( padding: EdgeInsets.all(16), child: Column(children: [ - SizedBox(height: 30.v), Container( padding: EdgeInsets.symmetric( horizontal: 24.h, @@ -134,8 +133,7 @@ class MyProfileScreen extends StatelessWidget { .toList(), )), SizedBox(height: 5.v), - ])))), - bottomNavigationBar: _buildBottomBar(context))); + ]))))), bottomNavigationBar: _buildBottomBar(context)); } /// Section Widget @@ -166,8 +164,7 @@ class MyProfileScreen extends StatelessWidget { ); } - addImage(BuildContext context) { - return () async { + addImage(BuildContext context) async { final picker = ImagePicker(); List? images = await picker.pickMultiImage(); if (images.isNotEmpty) { @@ -175,7 +172,6 @@ class MyProfileScreen extends StatelessWidget { context.read().add(UploadAvatar(image)); } } - }; } onTapSettings(BuildContext context) { diff --git a/lib/presentation/profile/my_profile_screen/my_settings_screen.dart b/lib/presentation/profile/my_profile_screen/my_settings_screen.dart index 82ddc56b..df45cdb9 100644 --- a/lib/presentation/profile/my_profile_screen/my_settings_screen.dart +++ b/lib/presentation/profile/my_profile_screen/my_settings_screen.dart @@ -44,11 +44,11 @@ class MySettingsScreen extends StatelessWidget { _buildSetingsScreen(BuildContext context, MyProfileLoadedState state) { mediaQueryData = MediaQuery.of(context); - return SafeArea( - child: Scaffold( + return Scaffold( backgroundColor: Colors.grey[200], resizeToAvoidBottomInset: true, - body: SingleChildScrollView( + body: SafeArea( + child: SingleChildScrollView( child: Container( width: double.maxFinite, decoration: BoxDecoration(color: Colors.grey[200]), @@ -170,9 +170,9 @@ class MySettingsScreen extends StatelessWidget { ), ), ), - ), - bottomNavigationBar: _buildBottomBar(context), + ), ), + bottomNavigationBar: _buildBottomBar(context), ); } diff --git a/lib/presentation/recipe/recipe_create_screen/recipe_create_screen.dart b/lib/presentation/recipe/recipe_create_screen/recipe_create_screen.dart index 82d2bd9a..fc37aa30 100644 --- a/lib/presentation/recipe/recipe_create_screen/recipe_create_screen.dart +++ b/lib/presentation/recipe/recipe_create_screen/recipe_create_screen.dart @@ -39,14 +39,13 @@ class RecipeCreateScreen extends StatelessWidget { _buildRecipeCreate(BuildContext context, RecipeCreateLoadedState state) { mediaQueryData = MediaQuery.of(context); - return SafeArea( - child: Scaffold( + return Scaffold( resizeToAvoidBottomInset: false, - body: Container( + body: SafeArea( + child: Container( width: double.maxFinite, decoration: AppDecoration.fillGray, - child: ListView(children: [ - SizedBox(height: 30.v), + child: ListView(children: [ Container( margin: EdgeInsets.only( left: 16.h, @@ -93,7 +92,7 @@ class RecipeCreateScreen extends StatelessWidget { ) ]), ), - bottomNavigationBar: _buildBottomBar(context))); + ), bottomNavigationBar: _buildBottomBar(context)); } } diff --git a/lib/presentation/recipe/recipe_edit_screen/recipe_edit_screen.dart b/lib/presentation/recipe/recipe_edit_screen/recipe_edit_screen.dart index 31a723a9..63a43e6a 100644 --- a/lib/presentation/recipe/recipe_edit_screen/recipe_edit_screen.dart +++ b/lib/presentation/recipe/recipe_edit_screen/recipe_edit_screen.dart @@ -41,14 +41,13 @@ class RecipeEditScreen extends StatelessWidget { _buildRecipeEdit(BuildContext context, RecipeEditLoadedState state) { mediaQueryData = MediaQuery.of(context); - return SafeArea( - child: Scaffold( + return Scaffold( resizeToAvoidBottomInset: false, - body: Container( + body: SafeArea( + child: Container( width: double.maxFinite, decoration: AppDecoration.fillGray, - child: ListView(children: [ - SizedBox(height: 30.v), + child: ListView(children: [ Container( margin: EdgeInsets.only( left: 16.h, @@ -110,7 +109,7 @@ class RecipeEditScreen extends StatelessWidget { ) ]), ), - bottomNavigationBar: _buildBottomBar(context))); + ), bottomNavigationBar: _buildBottomBar(context)); } } diff --git a/lib/presentation/recipe/recipe_select_screen/recipe_select_screen.dart b/lib/presentation/recipe/recipe_select_screen/recipe_select_screen.dart index 0623c053..0c143c6b 100644 --- a/lib/presentation/recipe/recipe_select_screen/recipe_select_screen.dart +++ b/lib/presentation/recipe/recipe_select_screen/recipe_select_screen.dart @@ -40,11 +40,11 @@ class RecipeSelectScreen extends StatelessWidget { _buildRecipeScreen(BuildContext context, RecipeSelectLoadedState state) { mediaQueryData = MediaQuery.of(context); - return SafeArea( - child: Scaffold( + return Scaffold( backgroundColor: Colors.grey[200], resizeToAvoidBottomInset: true, - body: SingleChildScrollView( + body: SafeArea( + child: SingleChildScrollView( child: Container( width: double.maxFinite, decoration: BoxDecoration(color: Colors.grey[200]), @@ -106,9 +106,9 @@ class RecipeSelectScreen extends StatelessWidget { ), ), ), - ), - bottomNavigationBar: _buildBottomBar(context), + ), ), + bottomNavigationBar: _buildBottomBar(context), ); } diff --git a/lib/presentation/recipe/recipe_show_screen/recipe_show_screen.dart b/lib/presentation/recipe/recipe_show_screen/recipe_show_screen.dart index ee757764..bad35e54 100644 --- a/lib/presentation/recipe/recipe_show_screen/recipe_show_screen.dart +++ b/lib/presentation/recipe/recipe_show_screen/recipe_show_screen.dart @@ -41,10 +41,10 @@ class RecipeScreen extends StatelessWidget { _buildRecipe(BuildContext context, RecipeLoadedState state) { mediaQueryData = MediaQuery.of(context); - return SafeArea( - child: Scaffold( + return Scaffold( resizeToAvoidBottomInset: false, - body: Container( + body: SafeArea( + child: Container( width: double.maxFinite, decoration: AppDecoration.fillGray, child: ListView( @@ -115,7 +115,7 @@ class RecipeScreen extends StatelessWidget { ], ), ), - bottomNavigationBar: _buildBottomBar(context))); + ), bottomNavigationBar: _buildBottomBar(context)); } ///Handling route based on bottom click actions diff --git a/lib/routes/app_routes.dart b/lib/routes/app_routes.dart index 7163f5e5..fe8ee0fb 100644 --- a/lib/routes/app_routes.dart +++ b/lib/routes/app_routes.dart @@ -126,6 +126,8 @@ class AppRoutes { static const String planCreateScreen = '/planCreate'; + static const String glossaryScreen = '/glossary'; + static Map get routes => { dateOfBirthScreen: DateOfBirthScreen.builder, cityOfLivingScreen: CityOfLivingScreen.builder, diff --git a/lib/widgets/app_bar/appbar_subtitle.dart b/lib/widgets/app_bar/appbar_subtitle.dart index 58779324..75784abc 100644 --- a/lib/widgets/app_bar/appbar_subtitle.dart +++ b/lib/widgets/app_bar/appbar_subtitle.dart @@ -21,7 +21,6 @@ class AppbarSubtitle extends StatelessWidget { @override Widget build(BuildContext context) { return GestureDetector( - onTap: onTapCall, child: Padding( padding: margin ?? EdgeInsets.zero, child: Text( @@ -33,8 +32,4 @@ class AppbarSubtitle extends StatelessWidget { ), ); } - - void onTapCall() { - onTap!.call(); - } } diff --git a/lib/widgets/custom_bottom_bar.dart b/lib/widgets/custom_bottom_bar.dart index d6e47d6d..f484a194 100644 --- a/lib/widgets/custom_bottom_bar.dart +++ b/lib/widgets/custom_bottom_bar.dart @@ -56,7 +56,7 @@ class CustomBottomBarState extends State { @override Widget build(BuildContext context) { return Container( - height: 83.v, + height: 100.v, decoration: BoxDecoration( border: Border.all( color: appTheme.whiteA700, @@ -105,21 +105,18 @@ class CustomBottomBarState extends State { double iconWidth; if (index == 0) { - // Для логотипа- - iconHeight = 52.v; // Увеличиваем высоту - iconWidth = 48.h; // Меняем ширину, чтобы сохранить пропорции + + iconHeight = 50.v; + iconWidth = 50.h; } else if (index == bottomMenuList.length - 2) { - // Для колокольчика - iconHeight = 20.v; // Уменьшаем высоту - iconWidth = 20.h; // Меняем ширину, чтобы сохранить пропорции + iconHeight = 20.v; + iconWidth = 20.h; } else if (index == bottomMenuList.length - 1) { - // Для колокольчика - iconHeight = 40.v; // Уменьшаем высоту - iconWidth = 40.h; // Меняем ширину, чтобы сохранить пропорции + iconHeight = 40.v; + iconWidth = 40.h; } else { - // Для остальных иконок - iconHeight = 24.v; // Стандартная высота - iconWidth = 19.h; // Стандартная ширина + iconHeight = 24.v; + iconWidth = 19.h; } return BottomNavigationBarItem( @@ -142,10 +139,9 @@ class CustomBottomBarState extends State { shadowColor: Colors.white, surfaceTintColor: Colors.white, position: RelativeRect.fromLTRB( - // Указываем позицию справа по центру MediaQuery.of(context).size.width - - 50, // Расположение от правого края - kToolbarHeight + 340, // Расположение от верхнего края + 50, + kToolbarHeight + 340, 0, // Не смещаем по горизонтали 0, // Не смещаем по вертикали ),