diff --git a/lib/providers/nutrition.dart b/lib/providers/nutrition.dart index 615f6bbef..0edfe9c1f 100644 --- a/lib/providers/nutrition.dart +++ b/lib/providers/nutrition.dart @@ -407,11 +407,11 @@ class NutritionPlansProvider with ChangeNotifier { }; if (isVegan) { - query['is_vegan'] = 'True'; + query['is_vegan'] = 'true'; } if (isVegetarian) { - query['is_vegetarian'] = 'True'; + query['is_vegetarian'] = 'true'; } // Send the request diff --git a/lib/widgets/nutrition/widgets.dart b/lib/widgets/nutrition/widgets.dart index 3b21e6176..c1796d747 100644 --- a/lib/widgets/nutrition/widgets.dart +++ b/lib/widgets/nutrition/widgets.dart @@ -83,8 +83,8 @@ class IngredientTypeahead extends StatefulWidget { } class _IngredientTypeaheadState extends State { - var _searchEnglish = true; late String barcode; + var _searchEnglish = true; var _isVegan = false; var _isVegetarian = false; @@ -243,7 +243,7 @@ class _IngredientTypeaheadState extends State { context: context, builder: (context) { return StatefulBuilder( - builder: (context, setState) { + builder: (context, setDialogState) { return AlertDialog( title: Text(i18n.filter), content: Column( @@ -254,34 +254,28 @@ class _IngredientTypeaheadState extends State { title: Text(i18n.searchNamesInEnglish), value: _searchEnglish, onChanged: (val) { - setState(() { + setDialogState(() { _searchEnglish = val; }); - this.setState(() {}); }, - dense: true, ), SwitchListTile( title: Text(i18n.isVegan), value: _isVegan, onChanged: (val) { - setState(() { + setDialogState(() { _isVegan = val; }); - this.setState(() {}); }, - dense: true, ), SwitchListTile( title: Text(i18n.isVegetarian), value: _isVegetarian, onChanged: (val) { - setState(() { + setDialogState(() { _isVegetarian = val; }); - this.setState(() {}); }, - dense: true, ), ], ),