diff --git a/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_action_card.dart b/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_action_card.dart index 61c09bbaaad..c212a2d48bf 100644 --- a/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_action_card.dart +++ b/packages/smooth_app/lib/knowledge_panel/knowledge_panels/knowledge_panel_action_card.dart @@ -65,7 +65,9 @@ class KnowledgePanelActionCard extends StatelessWidget { ); } if (kpAction == KnowledgePanelAction.addNutritionFacts) { - return AddNutritionButton(product); + if (AddNutritionButton.acceptsNutritionFacts(product)) { + return AddNutritionButton(product); + } } Logs.e('unhandled knowledge panel action: $action'); return null; diff --git a/packages/smooth_app/lib/knowledge_panel/knowledge_panels_builder.dart b/packages/smooth_app/lib/knowledge_panel/knowledge_panels_builder.dart index 4c9e7fd34a1..e60edf05757 100644 --- a/packages/smooth_app/lib/knowledge_panel/knowledge_panels_builder.dart +++ b/packages/smooth_app/lib/knowledge_panel/knowledge_panels_builder.dart @@ -65,7 +65,9 @@ class KnowledgePanelsBuilder { ProductState.NUTRITION_FACTS_COMPLETED.toBeCompletedTag) ?? false; if (nutritionAddOrUpdate) { - children.add(AddNutritionButton(product)); + if (AddNutritionButton.acceptsNutritionFacts(product)) { + children.add(AddNutritionButton(product)); + } } final bool needEditIngredients = context diff --git a/packages/smooth_app/lib/pages/product/add_nutrition_button.dart b/packages/smooth_app/lib/pages/product/add_nutrition_button.dart index 445fa12d418..27e7b002405 100644 --- a/packages/smooth_app/lib/pages/product/add_nutrition_button.dart +++ b/packages/smooth_app/lib/pages/product/add_nutrition_button.dart @@ -10,6 +10,10 @@ class AddNutritionButton extends StatelessWidget { final Product product; + static bool acceptsNutritionFacts(final Product product) => + product.productType != ProductType.product && + product.productType != ProductType.beauty; + @override Widget build(BuildContext context) => addPanelButton( AppLocalizations.of(context).score_add_missing_nutrition_facts, diff --git a/packages/smooth_app/pubspec.lock b/packages/smooth_app/pubspec.lock index 7d12b448aa9..4514dbf6068 100644 --- a/packages/smooth_app/pubspec.lock +++ b/packages/smooth_app/pubspec.lock @@ -1853,4 +1853,4 @@ packages: version: "3.1.2" sdks: dart: ">=3.5.3 <4.0.0" - flutter: ">=3.22.0" + flutter: ">=3.24.0"