barely functional database with hive

This commit is contained in:
SomnusVeritas
2023-11-06 18:19:52 +01:00
parent da4dc83193
commit d1da474998
9 changed files with 114 additions and 5 deletions

View File

@@ -9,6 +9,21 @@ class IngredientListEntry {
IngredientListEntry(this.ingredient, this.amount, this.unit, this.optional);
factory IngredientListEntry.fromJson(Map<String, dynamic> json) =>
IngredientListEntry(
Ingredient.fromJson(json['ingredient']),
json['amount'] as int,
Unit.fromJson(json['unit']),
json['optional'] as bool,
);
Map<String, dynamic> toJson() => {
'ingredient': ingredient.toJson(),
'amount': amount,
'unit': unit.toJson(),
'optional': optional,
};
@override
operator ==(Object other) {
final i = other as IngredientListEntry;