в процессе
This commit is contained in:
parent
ce0d99c433
commit
8421f194c6
@ -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,
|
||||
|
@ -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>)
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user