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 698d6e0c..2b3e7aef 100644 --- a/lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart +++ b/lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart @@ -55,38 +55,40 @@ class DiaryEditScreen extends StatelessWidget { alignment: Alignment.bottomCenter, 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( + appBar: AppBar( + toolbarHeight: 0, + automaticallyImplyLeading: false, + ), + 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), + ], ), ), ), - ], - ), + ), + ], ), ), ), @@ -142,12 +144,8 @@ class DiaryEditScreen extends StatelessWidget { ], ), child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.center, children: [ - CustomImageView( - imagePath: ImageConstant.imgArrowLeft, - onTap: () => GoRouter.of(context).pop(), - ), Padding( padding: EdgeInsets.only(top: 1.v), child: Column( 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 e573be6b..7bda468c 100644 --- a/lib/presentation/diets/diet_select_screen/diet_select_screen.dart +++ b/lib/presentation/diets/diet_select_screen/diet_select_screen.dart @@ -24,6 +24,11 @@ class DietSelectScreen extends StatelessWidget { builder: (context, state) { if (state is DietSelectInitialState) { // Это начальное состояние, данные ещё не загружены. + return Scaffold( + body: Center( + child: CircularProgressIndicator(), + ), + ); return CircularProgressIndicator( color: Colors.white, backgroundColor: Colors.white, @@ -33,7 +38,11 @@ class DietSelectScreen extends StatelessWidget { return _buildSetingsScreen(context, state); } else { // Другие состояния, если они есть. - return Container(); // Пустой контейнер для необработанных состояний. + return Scaffold( + body: Center( + child: CircularProgressIndicator(), + ), + ); } }, ); @@ -41,6 +50,10 @@ class DietSelectScreen extends StatelessWidget { _buildSetingsScreen(BuildContext context, DietSelectLoadedState state) { return Scaffold( + appBar: AppBar( + toolbarHeight: 0, + automaticallyImplyLeading: false, + ), backgroundColor: Colors.grey[200], resizeToAvoidBottomInset: true, body: SingleChildScrollView( diff --git a/lib/presentation/glossary/glossary_screen/glossary_screen.dart b/lib/presentation/glossary/glossary_screen/glossary_screen.dart index ebfa70d2..de262b33 100644 --- a/lib/presentation/glossary/glossary_screen/glossary_screen.dart +++ b/lib/presentation/glossary/glossary_screen/glossary_screen.dart @@ -22,8 +22,10 @@ class GlossaryScreen extends StatelessWidget { builder: (context, state) { if (state is GlossaryInitialState) { // Это начальное состояние, данные ещё не загружены. - return Container( - color: Colors.white, + return Scaffold( + body: Center( + child: CircularProgressIndicator(), + ), ); } else if (state is GlossaryLoadedState) { // Данные загружены, можно строить экран. @@ -33,7 +35,11 @@ class GlossaryScreen extends StatelessWidget { return Center(child: Text(state.errorMessage)); } else { // Другие состояния, если они есть. - return Container(); // Пустой контейнер для необработанных состояний. + return Scaffold( + body: Center( + child: CircularProgressIndicator(), + ), + ); } }, ); @@ -41,6 +47,10 @@ class GlossaryScreen extends StatelessWidget { _buildGlossary(BuildContext context, GlossaryLoadedState state) { return Scaffold( + appBar: AppBar( + toolbarHeight: 0, + automaticallyImplyLeading: false, + ), backgroundColor: Colors.grey[200], resizeToAvoidBottomInset: true, body: SingleChildScrollView( 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 78ac405f..6dd7e33d 100644 --- a/lib/presentation/plans/plan_select_screen/plan_select_screen.dart +++ b/lib/presentation/plans/plan_select_screen/plan_select_screen.dart @@ -24,16 +24,21 @@ class PlanSelectScreen extends StatelessWidget { builder: (context, state) { if (state is PlanSelectInitialState) { // Это начальное состояние, данные ещё не загружены. - return CircularProgressIndicator( - color: Colors.white, - backgroundColor: Colors.white, + return Scaffold( + body: Center( + child: CircularProgressIndicator(), + ), ); } else if (state is PlanSelectLoadedState) { // Данные загружены, можно строить экран. return _buildSetingsScreen(context, state); } else { // Другие состояния, если они есть. - return Container(); // Пустой контейнер для необработанных состояний. + return Scaffold( + body: Center( + child: CircularProgressIndicator(), + ), + ); } }, ); @@ -41,6 +46,10 @@ class PlanSelectScreen extends StatelessWidget { _buildSetingsScreen(BuildContext context, PlanSelectLoadedState state) { return Scaffold( + appBar: AppBar( + toolbarHeight: 0, + automaticallyImplyLeading: false, + ), backgroundColor: Colors.grey[200], resizeToAvoidBottomInset: true, body: SingleChildScrollView( 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 501ffcac..fe6de3c5 100644 --- a/lib/presentation/profile/my_profile_screen/my_settings_screen.dart +++ b/lib/presentation/profile/my_profile_screen/my_settings_screen.dart @@ -41,6 +41,10 @@ class MySettingsScreen extends StatelessWidget { _buildSetingsScreen(BuildContext context, MyProfileLoadedState state) { return Scaffold( + appBar: AppBar( + toolbarHeight: 0, + automaticallyImplyLeading: false, + ), backgroundColor: Colors.grey[200], resizeToAvoidBottomInset: true, body: SingleChildScrollView( 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 24268793..76e8a630 100644 --- a/lib/presentation/recipe/recipe_create_screen/recipe_create_screen.dart +++ b/lib/presentation/recipe/recipe_create_screen/recipe_create_screen.dart @@ -10,12 +10,12 @@ import 'package:eatvio_app/widgets/custom_outlined_button.dart'; class RecipeCreateScreen extends StatelessWidget { const RecipeCreateScreen({Key? key}) : super(key: key); + static Widget builder(BuildContext context) { final recipeID = ModalRoute.of(context)!.settings.arguments; return BlocProvider( - create: (context) => RecipeCreateBloc(RecipeCreateState( - recipeModelObj: RecipeCreateModel(recipeID: recipeID.toString()))) - ..add(RecipeCreateInitialEvent()), + create: (context) => + RecipeCreateBloc(RecipeCreateState(recipeModelObj: RecipeCreateModel(recipeID: recipeID.toString())))..add(RecipeCreateInitialEvent()), child: RecipeCreateScreen()); } @@ -52,25 +52,28 @@ class RecipeCreateScreen extends StatelessWidget { return RefreshIndicator( onRefresh: refreshPage(context), - child: SafeArea( - child: Scaffold( - resizeToAvoidBottomInset: false, - body: Container( - width: double.maxFinite, - decoration: BoxDecoration(color: Colors.grey[200]), - child: ListView(children: [ - _buldAppBar(context), - SizedBox(height: 20.v), - _buildRecipeInfo(state, context), - SizedBox(height: 20.v), - Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: steps, - ), - SizedBox(height: 20.v), - _buildAdditional(context, state) - ]), - )))); + child: Scaffold( + appBar: AppBar( + toolbarHeight: 0, + automaticallyImplyLeading: false, + ), + resizeToAvoidBottomInset: false, + body: Container( + width: double.maxFinite, + decoration: BoxDecoration(color: Colors.grey[200]), + child: ListView(children: [ + _buldAppBar(context), + SizedBox(height: 20.v), + _buildRecipeInfo(state, context), + SizedBox(height: 20.v), + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: steps, + ), + SizedBox(height: 20.v), + _buildAdditional(context, state) + ]), + ))); } _buldAppBar(BuildContext context) { @@ -280,8 +283,7 @@ class RecipeCreateScreen extends StatelessWidget { text: "Добавить шаг", buttonStyle: CustomButtonStyles.outlinePrimaryTL15, ), - if (isLastStep && - !isFirstStep) // Добавляем кнопку "Добавить шаг" только для последнего шага + if (isLastStep && !isFirstStep) // Добавляем кнопку "Добавить шаг" только для последнего шага Column( children: [ SizedBox(height: 16.0), @@ -290,8 +292,7 @@ class RecipeCreateScreen extends StatelessWidget { Flexible( flex: 5, child: CustomOutlinedButton( - onPressed: () => - context.read().add(AddStep()), + onPressed: () => context.read().add(AddStep()), text: "Добавить шаг", buttonStyle: CustomButtonStyles.outlinePrimaryTL15, ), @@ -301,8 +302,7 @@ class RecipeCreateScreen extends StatelessWidget { flex: 1, child: CustomOutlinedButton( text: "х", - onPressed: () => - context.read().add(RemoveStep(i)), + onPressed: () => context.read().add(RemoveStep(i)), buttonStyle: CustomButtonStyles.outlinePrimaryTL15, ), ), @@ -312,8 +312,7 @@ class RecipeCreateScreen extends StatelessWidget { ), if (!isLastStep && !isFirstStep) CustomOutlinedButton( - onPressed: () => - context.read().add(RemoveStep(i)), + onPressed: () => context.read().add(RemoveStep(i)), text: "x", buttonStyle: CustomButtonStyles.outlinePrimaryTL15, ), @@ -356,9 +355,7 @@ class RecipeCreateScreen extends StatelessWidget { ), ), SizedBox(height: 8.0), - Align( - alignment: Alignment.centerLeft, - child: Text("Ссылка на видео (необязательно)")), + Align(alignment: Alignment.centerLeft, child: Text("Ссылка на видео (необязательно)")), CustomTextFormField( controller: state.video_url, hintText: "YouTube", @@ -380,7 +377,6 @@ class RecipeCreateScreen extends StatelessWidget { ); } - Function onTapBack(BuildContext context) { return () { onTapArrowLeft(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 c2344e1a..b204e6f6 100644 --- a/lib/presentation/recipe/recipe_edit_screen/recipe_edit_screen.dart +++ b/lib/presentation/recipe/recipe_edit_screen/recipe_edit_screen.dart @@ -54,25 +54,28 @@ class RecipeEditScreen extends StatelessWidget { return RefreshIndicator( onRefresh: refreshPage(context), - child: SafeArea( - child: Scaffold( - resizeToAvoidBottomInset: false, - body: Container( - width: double.maxFinite, - decoration: BoxDecoration(color: Colors.grey[200]), - child: ListView(children: [ - _buldAppBar(context), - SizedBox(height: 20.v), - _buildRecipeInfo(state, context), - SizedBox(height: 20.v), - Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: steps, - ), - SizedBox(height: 20.v), - _buildAdditional(context, state) - ]), - )))); + child: Scaffold( + appBar: AppBar( + toolbarHeight: 0, + automaticallyImplyLeading: false, + ), + resizeToAvoidBottomInset: false, + body: Container( + width: double.maxFinite, + decoration: BoxDecoration(color: Colors.grey[200]), + child: ListView(children: [ + _buldAppBar(context), + SizedBox(height: 20.v), + _buildRecipeInfo(state, context), + SizedBox(height: 20.v), + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: steps, + ), + SizedBox(height: 20.v), + _buildAdditional(context, state) + ]), + ))); } _buldAppBar(BuildContext 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 f72ca514..1e0b1eba 100644 --- a/lib/presentation/recipe/recipe_select_screen/recipe_select_screen.dart +++ b/lib/presentation/recipe/recipe_select_screen/recipe_select_screen.dart @@ -41,6 +41,10 @@ class RecipeSelectScreen extends StatelessWidget { _buildRecipeScreen(BuildContext context, RecipeSelectLoadedState state) { return Scaffold( + appBar: AppBar( + toolbarHeight: 0, + automaticallyImplyLeading: false, + ), backgroundColor: Colors.grey[200], resizeToAvoidBottomInset: true, body: SingleChildScrollView( 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 ef38afff..195e3da6 100644 --- a/lib/presentation/recipe/recipe_show_screen/recipe_show_screen.dart +++ b/lib/presentation/recipe/recipe_show_screen/recipe_show_screen.dart @@ -50,30 +50,33 @@ class RecipeScreen extends StatelessWidget { steps.add(_buildStep(context, state, i)); } } - return SafeArea( - child: 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), - _buildRecipeData(context, state), - SizedBox(height: 15.v), - Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: steps, - ), - SizedBox(height: 15.v), - _buildTextField(context, state), - SizedBox(height: 15.v), - _buildCommentSection(context, state), - ], + return Scaffold( + appBar: AppBar( + toolbarHeight: 0, + automaticallyImplyLeading: false, + ), + resizeToAvoidBottomInset: false, + body: Container( + width: double.maxFinite, + decoration: AppDecoration.fillGray, + child: ListView( + children: [ + SizedBox(height: 15.v), + _buildHeaderRow(context, state), + SizedBox(height: 15.v), + _buildRecipeData(context, state), + SizedBox(height: 15.v), + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: steps, ), - ))); + SizedBox(height: 15.v), + _buildTextField(context, state), + SizedBox(height: 15.v), + _buildCommentSection(context, state), + ], + ), + )); } _buildHeaderRow(BuildContext context, RecipeLoadedState state) { diff --git a/lib/theme/theme_helper.dart b/lib/theme/theme_helper.dart index 699e2825..68aa928a 100644 --- a/lib/theme/theme_helper.dart +++ b/lib/theme/theme_helper.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import '../../core/app_export.dart'; /// Helper class for managing themes and colors. @@ -50,6 +51,13 @@ class ThemeHelper { colorScheme: colorScheme, textTheme: TextThemes.textTheme(colorScheme), scaffoldBackgroundColor: colorScheme.onPrimary, + appBarTheme: AppBarTheme( + systemOverlayStyle: SystemUiOverlayStyle( + statusBarIconBrightness: Brightness.dark, + statusBarBrightness: Brightness.light, + systemNavigationBarColor: Colors.white, + ), + ), outlinedButtonTheme: OutlinedButtonThemeData( style: OutlinedButton.styleFrom( backgroundColor: Colors.transparent, diff --git a/lib/widgets/app_bar/custom_app_bar.dart b/lib/widgets/app_bar/custom_app_bar.dart index 05811706..63c79539 100644 --- a/lib/widgets/app_bar/custom_app_bar.dart +++ b/lib/widgets/app_bar/custom_app_bar.dart @@ -31,10 +31,6 @@ class CustomAppBar extends StatelessWidget implements PreferredSizeWidget { @override Widget build(BuildContext context) { return AppBar( - systemOverlayStyle: SystemUiOverlayStyle( - statusBarIconBrightness: Brightness.dark, - statusBarBrightness: Brightness.light, - ), toolbarHeight: height ?? 56.v, automaticallyImplyLeading: false, backgroundColor: Colors.transparent,