import 'package:json_annotation/json_annotation.dart'; part 'recipes_dto.g.dart'; @JsonSerializable(createToJson: false) class RecipesDto { final List? data; final MetaDto? meta; const RecipesDto({ this.data, this.meta, }); factory RecipesDto.fromJson(Map json) => _$RecipesDtoFromJson(json); } @JsonSerializable(createToJson: false) class RecipeDataDto { final String? id; final String? type; final RecipeAttributesDataDto? attributes; const RecipeDataDto({this.id, this.type, this.attributes}); factory RecipeDataDto.fromJson(Map json) => _$RecipeDataDtoFromJson(json); } @JsonSerializable(createToJson: false) class RecipeAttributesDataDto { final String? name; final String? calories; final String? died; final String? image; const RecipeAttributesDataDto({this.name, this.calories, this.died, this.image}); factory RecipeAttributesDataDto.fromJson(Map json) => _$RecipeAttributesDataDtoFromJson(json); } @JsonSerializable(createToJson: false) class MetaDto { final PaginationDto? pagination; const MetaDto({this.pagination}); factory MetaDto.fromJson(Map json) => _$MetaDtoFromJson(json); } @JsonSerializable(createToJson: false) class PaginationDto { final int? next; const PaginationDto({ this.next}); factory PaginationDto.fromJson(Map json) => _$PaginationDtoFromJson(json); }