added expandable list of ingredients

This commit is contained in:
SomnusVeritas
2023-10-03 17:02:07 +02:00
parent 2d77247f1f
commit 10463bb61a
6 changed files with 128 additions and 48 deletions

View File

@@ -1,6 +1,8 @@
import 'unit.dart';
class Ingredient {
final String title;
List<String> possibleUnits = [];
List<Unit> possibleUnits = [];
List<String> preferredBrands = [];
Ingredient({

17
lib/models/unit.dart Normal file
View File

@@ -0,0 +1,17 @@
class Unit {
final String name;
final UnitType type;
final System system;
Unit(this.name, this.type, {this.system = System.metric});
}
enum System { metric, imperial, neutral }
enum UnitType {
metric,
imperial,
fluid,
weight,
count,
}