2024-10-18 19:29:21 +04:00
|
|
|
import 'dart:convert';
|
|
|
|
import 'dart:ffi';
|
|
|
|
|
|
|
|
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
|
2024-10-18 23:47:45 +04:00
|
|
|
part 'foods_dto.g.dart';
|
2024-10-18 19:29:21 +04:00
|
|
|
|
|
|
|
@JsonSerializable(createToJson: false)
|
|
|
|
class FoodsDto {
|
|
|
|
final List<FoodDataDto>? foods;
|
2024-10-18 23:47:45 +04:00
|
|
|
final MetaDto? meta;
|
2024-10-18 19:29:21 +04:00
|
|
|
|
2024-10-18 23:47:45 +04:00
|
|
|
const FoodsDto({this.foods, this.meta});
|
2024-10-18 19:29:21 +04:00
|
|
|
|
|
|
|
factory FoodsDto.fromJson(Map<String, dynamic> 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<String, dynamic> json) => _$FoodDataDtoFromJson(json);
|
2024-10-18 23:47:45 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
@JsonSerializable(createToJson: false)
|
|
|
|
class MetaDto {
|
|
|
|
final PaginationDto? pagination;
|
|
|
|
|
|
|
|
const MetaDto({this.pagination});
|
|
|
|
|
|
|
|
factory MetaDto.fromJson(Map<String, dynamic> 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<String, dynamic> json) => _$PaginationDtoFromJson(json);
|
2024-10-18 19:29:21 +04:00
|
|
|
}
|