import 'dart:convert'; import 'dart:ffi'; import 'package:json_annotation/json_annotation.dart'; part 'foods_dto.g.dart'; @JsonSerializable(createToJson: false) class FoodsDto { final List? foods; final MetaDto? meta; const FoodsDto({this.foods, this.meta}); factory FoodsDto.fromJson(Map json) => _$FoodsDtoFromJson(json); } @JsonSerializable(createToJson: false) class FoodDataDto { final int? fdcId; final String? brandName; final String? description; final String? image; const FoodDataDto({this.fdcId, this.brandName, this.description, this.image}); factory FoodDataDto.fromJson(Map json) => _$FoodDataDtoFromJson(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? current; final int? next; final int? last; const PaginationDto({this.current, this.next, this.last}); factory PaginationDto.fromJson(Map json) => _$PaginationDtoFromJson(json); }