feat(recipe): my recipes screen

This commit is contained in:
mso7nueh
2025-05-27 17:38:46 +03:00
parent 242cb474cc
commit 566a96b18e
10 changed files with 372 additions and 168 deletions

View File

@@ -0,0 +1,36 @@
import 'package:eatvio_app/features/feed/models/recipes_model.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
part 'my_recipe_model.g.dart';
part 'my_recipe_model.freezed.dart';
@freezed
abstract class MyRecipePaginationModel with _$MyRecipePaginationModel {
const factory MyRecipePaginationModel({
required List<MyRecipeModel> data,
}) = _MyRecipePaginationModel;
factory MyRecipePaginationModel.fromJson(Map<String, Object?> json) => _$MyRecipePaginationModelFromJson(json);
}
@freezed
abstract class MyRecipeModel with _$MyRecipeModel {
const factory MyRecipeModel({
required int id,
required String image,
required String state,
@JsonKey(name: 'cooking_time') required int cookingTime,
@JsonKey(name: 'active_time') required int activeCookingTime,
@JsonKey(name: 'description_md') required String description,
required List<Step>? steps,
@JsonKey(name: 'video_url') required String? videoUrl,
required String? title,
required String slug,
@JsonKey(name: 'energy_per_serving') required double calories,
@JsonKey(name: 'total_likes') required int likesCount,
@JsonKey(name: 'total_views') required int viewsCount,
}) = _MyRecipeModel;
factory MyRecipeModel.fromJson(Map<String, Object?> json) => _$MyRecipeModelFromJson(json);
}