import 'package:json_annotation/json_annotation.dart'; part 'ingredient_model.g.dart'; @JsonSerializable() class Ingredient { String? name; int? quantity; String? unit; Ingredient({ this.name, this.quantity, this.unit, }); Map toJson() => _$IngredientToJson(this); factory Ingredient.fromJson(Map json) => _$IngredientFromJson(json); }