feat(diary): add gallery

This commit is contained in:
mso7nueh
2024-11-01 05:24:08 +03:00
parent b0c687e5fe
commit 972ee605be
10 changed files with 555 additions and 299 deletions

View File

@@ -47,10 +47,10 @@ class MealModel with _$MealModel {
@freezed
class DiaryPhotoModel with _$DiaryPhotoModel {
const factory DiaryPhotoModel({
@JsonKey(name: "id") required String id,
@JsonKey(name: "id") required int id,
@JsonKey(name: "original_name") required String originalName,
@JsonKey(name: "path") required String path,
@JsonKey(name: "size") required String size,
@JsonKey(name: "size") required int size,
}) = _DiaryPhotoModel;
factory DiaryPhotoModel.fromJson(Map<String, dynamic> json) => _$DiaryPhotoModelFromJson(json);
@@ -78,3 +78,14 @@ class TypeOfDiaryModel with _$TypeOfDiaryModel {
factory TypeOfDiaryModel.fromJson(Map<String, dynamic> json) => _$TypeOfDiaryModelFromJson(json);
}
@freezed
class ProductInMeal with _$ProductInMeal {
const factory ProductInMeal({
@JsonKey(name: 'product_name') required String productName,
@JsonKey(name: 'portion') required String portion,
@JsonKey(name: 'quantity') required int quantity,
}) = _ProductInMeal;
factory ProductInMeal.fromJson(Map<String, Object?> json) => _$ProductInMealFromJson(json);
}