fix: profile roles

This commit is contained in:
BLoC
2025-02-12 14:44:58 +03:00
parent f44b9e5634
commit 970a30f436
34 changed files with 816 additions and 1292 deletions

View File

@@ -260,10 +260,10 @@ class _FeedScreenContentState extends State<FeedScreenContent> {
onTap: () => GoRouter.of(context).pushNamed(RecipeCreateScreen.name),
),
2 => AddItemButton(
onTap: state.profile?.role == 'consultant' ? () => GoRouter.of(context).pushNamed(CreateDietScreen.name) : null,
onTap: state.profile!.roles.contains('consultant') ? () => GoRouter.of(context).pushNamed(CreateDietScreen.name) : null,
),
3 => AddItemButton(
onTap: state.profile?.role == 'consultant' ? () => GoRouter.of(context).pushNamed(CreatePlanScreen.name) : null,
onTap: state.profile!.roles.contains('consultant') ? () => GoRouter.of(context).pushNamed(CreatePlanScreen.name) : null,
),
_ => AddItemButton()
},