Files
eatvio_app/lib/features/create_recipe/models/ingredient.dart

17 lines
459 B
Dart

import 'package:freezed_annotation/freezed_annotation.dart';
part 'ingredient.freezed.dart';
part 'ingredient.g.dart';
@freezed
class Ingredient with _$Ingredient {
const factory Ingredient({
required String name,
required String unit,
required String portion,
@JsonKey(name: 'product_nutritional_id') required int productId,
}) = _Ingredient;
factory Ingredient.fromJson(Map<String, Object?> json) => _$IngredientFromJson(json);
}