changed up the way that ingredients can be added

This commit is contained in:
SomnusVeritas
2023-10-04 16:35:17 +02:00
parent 518631f37f
commit 263fe00407
5 changed files with 133 additions and 8 deletions

27
lib/example_data.dart Normal file
View File

@@ -0,0 +1,27 @@
import 'package:rezepte/models/unit.dart';
import 'models/ingredient.dart';
import 'constants.dart' as constants;
final List<Unit> _weightAndCount = constants.units
.where((element) =>
element.type == UnitType.weight || element.type == UnitType.count)
.toList();
final List<Unit> _weight = constants.units
.where((element) => element.type == UnitType.weight)
.toList();
final List<Unit> _count =
constants.units.where((element) => element.type == UnitType.count).toList();
final List<Unit> _fluid =
constants.units.where((element) => element.type == UnitType.fluid).toList();
final List<Ingredient> exampleIngredients = [
Ingredient(title: 'Karotte', possibleUnits: _weightAndCount),
Ingredient(title: 'Kartoffel', possibleUnits: _weightAndCount),
Ingredient(title: 'Kaffeebohnen', possibleUnits: _weight),
Ingredient(title: 'Milch', possibleUnits: _fluid),
Ingredient(title: 'Limettenblätter', possibleUnits: _count),
];