From b0a167b9e949e9fc29b769fa5b5beac2077891b1 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Thu, 26 Feb 2026 03:00:32 +0300 Subject: [PATCH] feat: Add MyRecipesScreen to display user's recipes, manage active/drafted states, and navigate to recipe creation. --- .../presentation/pages/my_recipes_screen.dart | 46 +++++++++++++++---- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/lib/features/recipe/presentation/pages/my_recipes_screen.dart b/lib/features/recipe/presentation/pages/my_recipes_screen.dart index 2b8668a8..f3fc4b36 100644 --- a/lib/features/recipe/presentation/pages/my_recipes_screen.dart +++ b/lib/features/recipe/presentation/pages/my_recipes_screen.dart @@ -7,6 +7,8 @@ import 'package:eatvio_app/features/recipe/presentation/widgets/my_recipe_widget import 'package:eatvio_app/features/recipe/presentation/widgets/my_recipes_tab.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:eatvio_app/features/create_recipe/presentation/pages/recipe_create_screen.dart'; +import 'package:go_router/go_router.dart'; class MyRecipesScreen extends StatelessWidget { const MyRecipesScreen({super.key}); @@ -56,15 +58,41 @@ class MyRecipesScreen extends StatelessWidget { top: 16, left: 16, right: 16, - child: MyRecipesTab( - selectedIndex: state is MyRecipesStateLoaded ? (state.selectedState == MyRecipesCubit.drafted ? 1 : 0) : 0, - onTabChanged: (index) { - if (index == 0) { - context.read().setActiveState(); - } else { - context.read().setDraftedState(); - } - }, + child: Row( + children: [ + Expanded( + child: MyRecipesTab( + selectedIndex: state is MyRecipesStateLoaded ? (state.selectedState == MyRecipesCubit.drafted ? 1 : 0) : 0, + onTabChanged: (index) { + if (index == 0) { + context.read().setActiveState(); + } else { + context.read().setDraftedState(); + } + }, + ), + ), + const SizedBox(width: 8), + InkWell( + onTap: () { + context.push(RecipeCreateScreen.path); + }, + borderRadius: BorderRadius.circular(100), + child: Container( + width: 48, + height: 48, + decoration: BoxDecoration( + color: appTheme.blueA400, + shape: BoxShape.circle, + ), + child: Icon( + Icons.add, + color: appTheme.whiteA700, + size: 24, + ), + ), + ), + ], ), ), ],