49 lines
999 B
Dart
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});
|
|
} |