в процессе

This commit is contained in:
bulatova_karina 2024-11-19 15:41:39 +04:00
parent ce0d99c433
commit 8421f194c6
3 changed files with 4 additions and 0 deletions

View File

@ -17,12 +17,14 @@ class FilmsDto {
@JsonSerializable(createToJson: false)
class FilmDataDto {
final int? kinopoiskId;
final String nameRu;
final int year;
final List<GenreDto> genres;
final String posterUrl;
const FilmDataDto({
required this.kinopoiskId,
required this.nameRu,
required this.year,
required this.genres,

View File

@ -14,6 +14,7 @@ FilmsDto _$FilmsDtoFromJson(Map<String, dynamic> json) => FilmsDto(
);
FilmDataDto _$FilmDataDtoFromJson(Map<String, dynamic> json) => FilmDataDto(
kinopoiskId: (json['kinopoiskId'] as num?)?.toInt(),
nameRu: json['nameRu'] as String,
year: (json['year'] as num).toInt(),
genres: (json['genres'] as List<dynamic>)

View File

@ -17,6 +17,7 @@ extension FilmDataDtoToModel on FilmDataDto {
nameRu,
imageUrl: posterUrl ?? _imagePlaceholder,
descriptionText: _makeDescriptionText(year, genres),
id: kinopoiskId.toString(),
);
String _makeDescriptionText(int? year, List<GenreDto> genres) {