From 2e99f579b64133cffd2ccb3e1d5ed30819cfc316 Mon Sep 17 00:00:00 2001 From: maxxkim Date: Mon, 22 Apr 2024 13:54:54 +0300 Subject: [PATCH] feat(diary): Navbar added to diary edit screen --- .../chat_select_screen.dart | 4 +- .../diary_edit_screen/diary_edit_screen.dart | 113 ++++++++++-------- 2 files changed, 67 insertions(+), 50 deletions(-) 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 563c487e..f92e2e3b 100644 --- a/lib/presentation/chat/chat_select_screen/chat_select_screen.dart +++ b/lib/presentation/chat/chat_select_screen/chat_select_screen.dart @@ -61,7 +61,7 @@ class ChatSelectScreen extends StatelessWidget { }, ), SizedBox(height: 20.v), - _buildUserprofile(context) + _buildChatList(context) ], ), ) @@ -72,7 +72,7 @@ class ChatSelectScreen extends StatelessWidget { ); } - _buildUserprofile(BuildContext context) { + _buildChatList(BuildContext context) { return BlocSelector( selector: (state) => state.chatSelectModelObj, builder: (context, chatSelectModelObj) { 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 e742aac5..b189b214 100644 --- a/lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart +++ b/lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart @@ -13,7 +13,7 @@ import 'package:eatvio_app/widgets/custom_edit_text_form_field.dart'; import 'package:eatvio_app/widgets/custom_edit_drop_down.dart'; import 'package:eatvio_app/widgets/custom_outlined_button.dart'; import 'package:eatvio_app/widgets/custom_scale_element.dart'; -//import 'package:eatvio_app/widgets/custom_bottom_bar.dart'; +import 'package:eatvio_app/widgets/custom_bottom_bar.dart'; import 'package:carousel_slider/carousel_slider.dart'; // ignore: must_be_immutable @@ -57,44 +57,73 @@ class DiaryEditScreen extends StatelessWidget { BuildContext context, DiaryEditLoadedState state) { mediaQueryData = MediaQuery.of(context); return RefreshIndicator( - onRefresh: refreshPage(context), - child: FormBuilder( + onRefresh: refreshPage(context), + child: Stack( + children: [ + FormBuilder( child: SafeArea( - child: Scaffold( - backgroundColor: Color.fromARGB(255, 240, 242, 245), - resizeToAvoidBottomInset: true, - body: SizedBox( - width: double.maxFinite, - child: Column( - children: [ - Expanded( - child: SingleChildScrollView( - child: Padding( - padding: EdgeInsets.only(bottom: 5.v), - child: Column( - children: [ - _buildHeaderRow(context, state), - SizedBox(height: 30.v), - _buildWakupRetire(context, state), - SizedBox(height: 30.v), - _buildMeal(context, state), - SizedBox(height: 20.v), - _buildMood(context, state), - SizedBox(height: 30.v), - _buildNutritionChart(context, state), - SizedBox(height: 30.v), - _buildComment(context, state), - ], + child: Scaffold( + backgroundColor: Color.fromARGB(255, 240, 242, 245), + resizeToAvoidBottomInset: true, + body: SizedBox( + width: double.maxFinite, + child: Column( + children: [ + Expanded( + child: SingleChildScrollView( + child: Padding( + padding: EdgeInsets.only(bottom: 5.v), + child: Column( + children: [ + _buildHeaderRow(context, state), + SizedBox(height: 30.v), + _buildWakupRetire(context, state), + SizedBox(height: 30.v), + _buildMeal(context, state), + SizedBox(height: 20.v), + _buildMood(context, state), + SizedBox(height: 30.v), + _buildNutritionChart(context, state), + SizedBox(height: 30.v), + _buildComment(context, state), + ], + ), + ), ), ), - ), + ], ), - ], + ), + bottomNavigationBar: _buildBottomBar(context), ), ), - bottomNavigationBar: _buildEndDay(context), ), - ))); + Positioned( + left: 16.h, + right: 16.h, + bottom: 50.v, // Adjusted position to lift the button higher + child: _buildEndDay(context), + ), + ], + ), + ); + } + + _buildEndDay(BuildContext context) { + return CustomOutlinedButton( + text: "Закончить день", + margin: EdgeInsets.only( + left: 16.h, + right: 16.h, + bottom: 41.v, + ), + buttonStyle: CustomButtonStyles.outlinePrimaryTL15, + decoration: BoxDecoration( + color: Colors.transparent, + ), + onPressed: onFinishDayPressed(context), + // Установите прозрачный фон + ); } refreshPage(BuildContext context) { @@ -159,6 +188,10 @@ class DiaryEditScreen extends StatelessWidget { }; } + _buildBottomBar(BuildContext context) { + return CustomBottomBar(onChanged: (BottomBarEnum type) {}); + } + /// Section Widget _buildAddProduct(BuildContext context, DiaryEditLoadedState state) { return CustomOutlinedButton( @@ -1082,22 +1115,6 @@ class DiaryEditScreen extends StatelessWidget { } /// Section Widget - _buildEndDay(BuildContext context) { - return CustomOutlinedButton( - text: "Закончить день", - margin: EdgeInsets.only( - left: 16.h, - right: 16.h, - bottom: 41.v, - ), - buttonStyle: CustomButtonStyles.outlinePrimaryTL15, - decoration: BoxDecoration( - color: Colors.transparent, - ), - onPressed: onFinishDayPressed(context), - // Установите прозрачный фон - ); - } Function() onFinishDayPressed(BuildContext context) { return () {