2024-10-18 23:47:45 +04:00

49 lines
1.2 KiB
Dart

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<FoodDataDto>? foods;
final MetaDto? meta;
const FoodsDto({this.foods, this.meta});
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);
}
@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);
}