From 2da3b10e6323b3b1d23ab77254be9a2b8c5b7a13 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Tue, 17 Mar 2026 12:18:17 +0300 Subject: [PATCH] feat: Implement 'My Recipes' feature, add diary moderation request modal, and introduce diary repository. --- .../glossary_moderation_request_modal_widget.dart | 13 +++++++++---- .../diary/repositories/diary_repository.dart | 6 +++++- .../presentation/pages/my_recipes_screen.dart | 7 +++++-- .../presentation/widgets/my_recipe_widget.dart | 10 ++++++++-- 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/lib/features/diary/presentation/widgets/glossary_moderation_request_modal_widget.dart b/lib/features/diary/presentation/widgets/glossary_moderation_request_modal_widget.dart index 286126a6..1c93bb8f 100644 --- a/lib/features/diary/presentation/widgets/glossary_moderation_request_modal_widget.dart +++ b/lib/features/diary/presentation/widgets/glossary_moderation_request_modal_widget.dart @@ -257,12 +257,17 @@ class _GlossaryModerationRequestModalWidgetState extends State().getMyRecipes(); + } }, borderRadius: BorderRadius.circular(100), child: Container( diff --git a/lib/features/recipe/presentation/widgets/my_recipe_widget.dart b/lib/features/recipe/presentation/widgets/my_recipe_widget.dart index 31c92082..d008ee08 100644 --- a/lib/features/recipe/presentation/widgets/my_recipe_widget.dart +++ b/lib/features/recipe/presentation/widgets/my_recipe_widget.dart @@ -155,7 +155,10 @@ class _MyRecipeWidgetState extends State { final fullRecipe = await context.read().getRecipeById(widget.recipe.slug); if (context.mounted) { Navigator.pop(context); // close dialog - context.push(RecipeCreateScreen.path, extra: fullRecipe); + await context.push(RecipeCreateScreen.path, extra: fullRecipe); + if (context.mounted) { + context.read().setDraftedState(); + } } }, height: 52, @@ -236,10 +239,13 @@ class _MyRecipeWidgetState extends State { } else { showErrorToast('Заполните все необходимые поля для публикации рецепта'); if (context.mounted) { - context.push(RecipeCreateScreen.path, extra: { + await context.push(RecipeCreateScreen.path, extra: { 'recipe': fullRecipe, 'autoValidate': true, }); + if (context.mounted) { + context.read().setDraftedState(); + } } } await createCubit.close();