PIbd-31_IevlewaMD_PMD/lib/data/dto/album_dto.dart
2024-11-08 13:07:43 +04:00

49 lines
999 B
Dart

import 'package:json_annotation/json_annotation.dart';
import 'package:uuid/uuid.dart';
@JsonSerializable(createToJson: false)
class AlbumDto {
final List<AlbumDataDto>? data;
const AlbumDto({this.data,});
}
@JsonSerializable(createToJson: false)
class AlbumDataDto {
final String id;
final String? title;
final String? artist;
String? year;
List<String>? genres;
List<String>? tracks;
String? summary;
String? url;
final AlbumDataImagesDto? images;
AlbumDataDto({
String? id,
this.title,
this.artist,
this.year,
this.genres,
this.tracks,
this.summary,
this.url,
this.images,
}) : id = id ?? const Uuid().v4(); // Генерация id
}
@JsonSerializable(createToJson: false)
class AlbumDataImagesDto {
final AlbumDataImagesJPGDto? jpg;
const AlbumDataImagesDto({this.jpg});
}
@JsonSerializable(createToJson: false)
class AlbumDataImagesJPGDto {
final String? image_url;
const AlbumDataImagesJPGDto({this.image_url});
}