fat(recipes, diets): added list refreshing

This commit is contained in:
misha
2026-03-16 10:32:12 +03:00
parent f5d14d213f
commit 5cb121d733
6 changed files with 55 additions and 15 deletions

View File

@@ -74,8 +74,14 @@ class MyRecipesScreen extends StatelessWidget {
),
const SizedBox(width: 8),
InkWell(
onTap: () {
context.push(RecipeCreateScreen.path);
onTap: () async {
final result = await context.push(RecipeCreateScreen.path);
if (!context.mounted) return;
if (result == MyRecipesCubit.drafted) {
await context.read<MyRecipesCubit>().setDraftedState();
} else if (result == MyRecipesCubit.active) {
await context.read<MyRecipesCubit>().setActiveState();
}
},
borderRadius: BorderRadius.circular(100),
child: Container(