import 'package:json_annotation/json_annotation.dart'; part 'films_dto.g.dart'; @JsonSerializable(createToJson: false) class FilmsDto { final List? data; final MetaDto? meta; const FilmsDto({ this.data, this.meta, }); factory FilmsDto.fromJson(Map json) => _$FilmsDtoFromJson(json); } @JsonSerializable(createToJson: false) class FilmDataDto { final String? id; final String? type; final FilmAttributesDataDto? attributes; const FilmDataDto({this.id, this.type, this.attributes}); factory FilmDataDto.fromJson(Map json) => _$FilmDataDtoFromJson(json); } @JsonSerializable(createToJson: false) class FilmAttributesDataDto { final String? title; final DateTime? release_date; final String? budget; final String? poster; const FilmAttributesDataDto({this.title, this.release_date, this.budget, this.poster}); factory FilmAttributesDataDto.fromJson(Map json) => _$FilmAttributesDataDtoFromJson(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); }