forked from eatvio/eatvio_app
37 lines
1.3 KiB
Dart
37 lines
1.3 KiB
Dart
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);
|
|
}
|