This commit is contained in:
Roland Geider
2026-02-27 11:28:56 +01:00
parent 92a43c6ca7
commit 81430ff7bc
2 changed files with 7 additions and 13 deletions

View File

@@ -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

View File

@@ -83,8 +83,8 @@ class IngredientTypeahead extends StatefulWidget {
}
class _IngredientTypeaheadState extends State<IngredientTypeahead> {
var _searchEnglish = true;
late String barcode;
var _searchEnglish = true;
var _isVegan = false;
var _isVegetarian = false;
@@ -243,7 +243,7 @@ class _IngredientTypeaheadState extends State<IngredientTypeahead> {
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<IngredientTypeahead> {
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,
),
],
),