Pato05
950969b774
add favorite button in notifications\nfix android tv\ntry to fix library tracks (unsuccessful)\nbetter MenuSheet
1580 lines
43 KiB
Dart
1580 lines
43 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'definitions.dart';
|
|
|
|
// **************************************************************************
|
|
// TypeAdapterGenerator
|
|
// **************************************************************************
|
|
|
|
class TrackAdapter extends TypeAdapter<Track> {
|
|
@override
|
|
final int typeId = 5;
|
|
|
|
@override
|
|
Track read(BinaryReader reader) {
|
|
final numOfFields = reader.readByte();
|
|
final fields = <int, dynamic>{
|
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
|
};
|
|
return Track(
|
|
id: fields[0] as String,
|
|
title: fields[1] as String?,
|
|
duration: fields[4] as Duration?,
|
|
album: fields[2] as Album?,
|
|
playbackDetails: (fields[13] as List?)?.cast<dynamic>(),
|
|
albumArt: fields[5] as DeezerImageDetails?,
|
|
artists: (fields[3] as List?)?.cast<Artist>(),
|
|
trackNumber: fields[6] as int?,
|
|
offline: fields[7] as bool?,
|
|
lyrics: fields[8] as Lyrics?,
|
|
favorite: fields[9] as bool?,
|
|
diskNumber: fields[10] as int?,
|
|
explicit: fields[11] as bool?,
|
|
addedDate: fields[12] as int?,
|
|
);
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, Track obj) {
|
|
writer
|
|
..writeByte(14)
|
|
..writeByte(0)
|
|
..write(obj.id)
|
|
..writeByte(1)
|
|
..write(obj.title)
|
|
..writeByte(2)
|
|
..write(obj.album)
|
|
..writeByte(3)
|
|
..write(obj.artists)
|
|
..writeByte(4)
|
|
..write(obj.duration)
|
|
..writeByte(5)
|
|
..write(obj.albumArt)
|
|
..writeByte(6)
|
|
..write(obj.trackNumber)
|
|
..writeByte(7)
|
|
..write(obj.offline)
|
|
..writeByte(8)
|
|
..write(obj.lyrics)
|
|
..writeByte(9)
|
|
..write(obj.favorite)
|
|
..writeByte(10)
|
|
..write(obj.diskNumber)
|
|
..writeByte(11)
|
|
..write(obj.explicit)
|
|
..writeByte(12)
|
|
..write(obj.addedDate)
|
|
..writeByte(13)
|
|
..write(obj.playbackDetails);
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is TrackAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|
|
|
|
class AlbumAdapter extends TypeAdapter<Album> {
|
|
@override
|
|
final int typeId = 12;
|
|
|
|
@override
|
|
Album read(BinaryReader reader) {
|
|
final numOfFields = reader.readByte();
|
|
final fields = <int, dynamic>{
|
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
|
};
|
|
return Album(
|
|
id: fields[0] as String?,
|
|
title: fields[1] as String?,
|
|
art: fields[4] as DeezerImageDetails?,
|
|
artists: (fields[2] as List?)?.cast<Artist>(),
|
|
tracks: (fields[3] as List?)?.cast<Track>(),
|
|
fans: fields[5] as int?,
|
|
offline: fields[6] as bool?,
|
|
library: fields[7] as bool?,
|
|
type: fields[8] as AlbumType?,
|
|
releaseDate: fields[9] as String?,
|
|
favoriteDate: fields[10] as String?,
|
|
);
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, Album obj) {
|
|
writer
|
|
..writeByte(11)
|
|
..writeByte(0)
|
|
..write(obj.id)
|
|
..writeByte(1)
|
|
..write(obj.title)
|
|
..writeByte(2)
|
|
..write(obj.artists)
|
|
..writeByte(3)
|
|
..write(obj.tracks)
|
|
..writeByte(4)
|
|
..write(obj.art)
|
|
..writeByte(5)
|
|
..write(obj.fans)
|
|
..writeByte(6)
|
|
..write(obj.offline)
|
|
..writeByte(7)
|
|
..write(obj.library)
|
|
..writeByte(8)
|
|
..write(obj.type)
|
|
..writeByte(9)
|
|
..write(obj.releaseDate)
|
|
..writeByte(10)
|
|
..write(obj.favoriteDate);
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is AlbumAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|
|
|
|
class ArtistAdapter extends TypeAdapter<Artist> {
|
|
@override
|
|
final int typeId = 11;
|
|
|
|
@override
|
|
Artist read(BinaryReader reader) {
|
|
final numOfFields = reader.readByte();
|
|
final fields = <int, dynamic>{
|
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
|
};
|
|
return Artist(
|
|
id: fields[0] as String,
|
|
name: fields[1] as String?,
|
|
albums: (fields[2] as List?)?.cast<Album>(),
|
|
albumCount: fields[3] as int?,
|
|
topTracks: (fields[4] as List?)?.cast<Track>(),
|
|
picture: fields[5] as DeezerImageDetails?,
|
|
fans: fields[6] as int?,
|
|
offline: fields[7] as bool?,
|
|
library: fields[8] as bool?,
|
|
radio: fields[9] as bool?,
|
|
favoriteDate: fields[10] as String?,
|
|
highlight: fields[11] as ArtistHighlight?,
|
|
);
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, Artist obj) {
|
|
writer
|
|
..writeByte(12)
|
|
..writeByte(0)
|
|
..write(obj.id)
|
|
..writeByte(1)
|
|
..write(obj.name)
|
|
..writeByte(2)
|
|
..write(obj.albums)
|
|
..writeByte(3)
|
|
..write(obj.albumCount)
|
|
..writeByte(4)
|
|
..write(obj.topTracks)
|
|
..writeByte(5)
|
|
..write(obj.picture)
|
|
..writeByte(6)
|
|
..write(obj.fans)
|
|
..writeByte(7)
|
|
..write(obj.offline)
|
|
..writeByte(8)
|
|
..write(obj.library)
|
|
..writeByte(9)
|
|
..write(obj.radio)
|
|
..writeByte(10)
|
|
..write(obj.favoriteDate)
|
|
..writeByte(11)
|
|
..write(obj.highlight);
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is ArtistAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|
|
|
|
class PlaylistAdapter extends TypeAdapter<Playlist> {
|
|
@override
|
|
final int typeId = 9;
|
|
|
|
@override
|
|
Playlist read(BinaryReader reader) {
|
|
final numOfFields = reader.readByte();
|
|
final fields = <int, dynamic>{
|
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
|
};
|
|
return Playlist(
|
|
id: fields[0] as String,
|
|
title: fields[1] as String?,
|
|
tracks: (fields[2] as List?)?.cast<Track>(),
|
|
image: fields[3] as ImageDetails?,
|
|
trackCount: fields[5] as int?,
|
|
duration: fields[4] as Duration?,
|
|
user: fields[6] as User?,
|
|
fans: fields[7] as int?,
|
|
library: fields[8] as bool?,
|
|
description: fields[9] as String?,
|
|
);
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, Playlist obj) {
|
|
writer
|
|
..writeByte(10)
|
|
..writeByte(0)
|
|
..write(obj.id)
|
|
..writeByte(1)
|
|
..write(obj.title)
|
|
..writeByte(2)
|
|
..write(obj.tracks)
|
|
..writeByte(3)
|
|
..write(obj.image)
|
|
..writeByte(4)
|
|
..write(obj.duration)
|
|
..writeByte(5)
|
|
..write(obj.trackCount)
|
|
..writeByte(6)
|
|
..write(obj.user)
|
|
..writeByte(7)
|
|
..write(obj.fans)
|
|
..writeByte(8)
|
|
..write(obj.library)
|
|
..writeByte(9)
|
|
..write(obj.description);
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is PlaylistAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|
|
|
|
class UserAdapter extends TypeAdapter<User> {
|
|
@override
|
|
final int typeId = 10;
|
|
|
|
@override
|
|
User read(BinaryReader reader) {
|
|
final numOfFields = reader.readByte();
|
|
final fields = <int, dynamic>{
|
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
|
};
|
|
return User(
|
|
id: fields[0] as String?,
|
|
name: fields[1] as String?,
|
|
picture: fields[2] as DeezerImageDetails?,
|
|
);
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, User obj) {
|
|
writer
|
|
..writeByte(3)
|
|
..writeByte(0)
|
|
..write(obj.id)
|
|
..writeByte(1)
|
|
..write(obj.name)
|
|
..writeByte(2)
|
|
..write(obj.picture);
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is UserAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|
|
|
|
class DeezerImageDetailsAdapter extends TypeAdapter<DeezerImageDetails> {
|
|
@override
|
|
final int typeId = 6;
|
|
|
|
@override
|
|
DeezerImageDetails read(BinaryReader reader) {
|
|
final numOfFields = reader.readByte();
|
|
final fields = <int, dynamic>{
|
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
|
};
|
|
return DeezerImageDetails(
|
|
fields[1] as String,
|
|
type: fields[0] as String,
|
|
);
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, DeezerImageDetails obj) {
|
|
writer
|
|
..writeByte(2)
|
|
..writeByte(0)
|
|
..write(obj.type)
|
|
..writeByte(1)
|
|
..write(obj.md5);
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is DeezerImageDetailsAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|
|
|
|
class LyricsAdapter extends TypeAdapter<Lyrics> {
|
|
@override
|
|
final int typeId = 7;
|
|
|
|
@override
|
|
Lyrics read(BinaryReader reader) {
|
|
final numOfFields = reader.readByte();
|
|
final fields = <int, dynamic>{
|
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
|
};
|
|
return Lyrics(
|
|
id: fields[0] as String?,
|
|
writers: fields[1] as String?,
|
|
lyrics: (fields[2] as List?)?.cast<Lyric>(),
|
|
);
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, Lyrics obj) {
|
|
writer
|
|
..writeByte(3)
|
|
..writeByte(0)
|
|
..write(obj.id)
|
|
..writeByte(1)
|
|
..write(obj.writers)
|
|
..writeByte(2)
|
|
..write(obj.lyrics);
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is LyricsAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|
|
|
|
class LyricAdapter extends TypeAdapter<Lyric> {
|
|
@override
|
|
final int typeId = 8;
|
|
|
|
@override
|
|
Lyric read(BinaryReader reader) {
|
|
final numOfFields = reader.readByte();
|
|
final fields = <int, dynamic>{
|
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
|
};
|
|
return Lyric(
|
|
offset: fields[0] as Duration?,
|
|
text: fields[1] as String?,
|
|
lrcTimestamp: fields[2] as String?,
|
|
);
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, Lyric obj) {
|
|
writer
|
|
..writeByte(3)
|
|
..writeByte(0)
|
|
..write(obj.offset)
|
|
..writeByte(1)
|
|
..write(obj.text)
|
|
..writeByte(2)
|
|
..write(obj.lrcTimestamp);
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is LyricAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|
|
|
|
class QueueSourceAdapter extends TypeAdapter<QueueSource> {
|
|
@override
|
|
final int typeId = 32;
|
|
|
|
@override
|
|
QueueSource read(BinaryReader reader) {
|
|
final numOfFields = reader.readByte();
|
|
final fields = <int, dynamic>{
|
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
|
};
|
|
return QueueSource(
|
|
id: fields[0] as String?,
|
|
text: fields[1] as String?,
|
|
source: fields[2] as String?,
|
|
);
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, QueueSource obj) {
|
|
writer
|
|
..writeByte(3)
|
|
..writeByte(0)
|
|
..write(obj.id)
|
|
..writeByte(1)
|
|
..write(obj.text)
|
|
..writeByte(2)
|
|
..write(obj.source);
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is QueueSourceAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|
|
|
|
class SmartTrackListAdapter extends TypeAdapter<SmartTrackList> {
|
|
@override
|
|
final int typeId = 4;
|
|
|
|
@override
|
|
SmartTrackList read(BinaryReader reader) {
|
|
final numOfFields = reader.readByte();
|
|
final fields = <int, dynamic>{
|
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
|
};
|
|
return SmartTrackList(
|
|
id: fields[0] as String?,
|
|
title: fields[1] as String?,
|
|
description: fields[3] as String?,
|
|
trackCount: fields[4] as int?,
|
|
tracks: (fields[5] as List?)?.cast<Track>(),
|
|
cover: (fields[6] as List?)?.cast<DeezerImageDetails>(),
|
|
subtitle: fields[2] as String?,
|
|
flowConfig: fields[7] as String?,
|
|
);
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, SmartTrackList obj) {
|
|
writer
|
|
..writeByte(8)
|
|
..writeByte(0)
|
|
..write(obj.id)
|
|
..writeByte(1)
|
|
..write(obj.title)
|
|
..writeByte(2)
|
|
..write(obj.subtitle)
|
|
..writeByte(3)
|
|
..write(obj.description)
|
|
..writeByte(4)
|
|
..write(obj.trackCount)
|
|
..writeByte(5)
|
|
..write(obj.tracks)
|
|
..writeByte(6)
|
|
..write(obj.cover)
|
|
..writeByte(7)
|
|
..write(obj.flowConfig);
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is SmartTrackListAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|
|
|
|
class HomePageAdapter extends TypeAdapter<HomePage> {
|
|
@override
|
|
final int typeId = 33;
|
|
|
|
@override
|
|
HomePage read(BinaryReader reader) {
|
|
final numOfFields = reader.readByte();
|
|
final fields = <int, dynamic>{
|
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
|
};
|
|
return HomePage(
|
|
sections: (fields[0] as List).cast<HomePageSection>(),
|
|
lastUpdated: fields[1] as DateTime?,
|
|
);
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, HomePage obj) {
|
|
writer
|
|
..writeByte(2)
|
|
..writeByte(0)
|
|
..write(obj.sections)
|
|
..writeByte(1)
|
|
..write(obj.lastUpdated);
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is HomePageAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|
|
|
|
class HomePageSectionAdapter extends TypeAdapter<HomePageSection> {
|
|
@override
|
|
final int typeId = 0;
|
|
|
|
@override
|
|
HomePageSection read(BinaryReader reader) {
|
|
final numOfFields = reader.readByte();
|
|
final fields = <int, dynamic>{
|
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
|
};
|
|
return HomePageSection(
|
|
layout: fields[1] as HomePageSectionLayout,
|
|
items: (fields[4] as List?)?.cast<HomePageItem>(),
|
|
title: fields[0] as String?,
|
|
pagePath: fields[2] as String?,
|
|
hasMore: fields[3] as bool?,
|
|
);
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, HomePageSection obj) {
|
|
writer
|
|
..writeByte(5)
|
|
..writeByte(0)
|
|
..write(obj.title)
|
|
..writeByte(1)
|
|
..write(obj.layout)
|
|
..writeByte(2)
|
|
..write(obj.pagePath)
|
|
..writeByte(3)
|
|
..write(obj.hasMore)
|
|
..writeByte(4)
|
|
..write(obj.items);
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is HomePageSectionAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|
|
|
|
class HomePageItemAdapter extends TypeAdapter<HomePageItem> {
|
|
@override
|
|
final int typeId = 1;
|
|
|
|
@override
|
|
HomePageItem read(BinaryReader reader) {
|
|
final numOfFields = reader.readByte();
|
|
final fields = <int, dynamic>{
|
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
|
};
|
|
return HomePageItem(
|
|
type: fields[0] as HomePageItemType,
|
|
value: fields[1] as dynamic,
|
|
);
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, HomePageItem obj) {
|
|
writer
|
|
..writeByte(2)
|
|
..writeByte(0)
|
|
..write(obj.type)
|
|
..writeByte(1)
|
|
..write(obj.value);
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is HomePageItemAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|
|
|
|
class DeezerChannelAdapter extends TypeAdapter<DeezerChannel> {
|
|
@override
|
|
final int typeId = 14;
|
|
|
|
@override
|
|
DeezerChannel read(BinaryReader reader) {
|
|
final numOfFields = reader.readByte();
|
|
final fields = <int, dynamic>{
|
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
|
};
|
|
return DeezerChannel(
|
|
id: fields[0] as String?,
|
|
title: fields[2] as String?,
|
|
backgroundColor: fields[3] as Color,
|
|
target: fields[1] as String?,
|
|
logo: fields[4] as DeezerImageDetails?,
|
|
picture: fields[5] as DeezerImageDetails?,
|
|
);
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, DeezerChannel obj) {
|
|
writer
|
|
..writeByte(6)
|
|
..writeByte(0)
|
|
..write(obj.id)
|
|
..writeByte(1)
|
|
..write(obj.target)
|
|
..writeByte(2)
|
|
..write(obj.title)
|
|
..writeByte(3)
|
|
..write(obj.backgroundColor)
|
|
..writeByte(4)
|
|
..write(obj.logo)
|
|
..writeByte(5)
|
|
..write(obj.picture);
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is DeezerChannelAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|
|
|
|
class SortingAdapter extends TypeAdapter<Sorting> {
|
|
@override
|
|
final int typeId = 17;
|
|
|
|
@override
|
|
Sorting read(BinaryReader reader) {
|
|
final numOfFields = reader.readByte();
|
|
final fields = <int, dynamic>{
|
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
|
};
|
|
return Sorting(
|
|
type: fields[0] as SortType?,
|
|
reverse: fields[1] as bool?,
|
|
id: fields[2] as String?,
|
|
sourceType: fields[3] as SortSourceTypes?,
|
|
);
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, Sorting obj) {
|
|
writer
|
|
..writeByte(4)
|
|
..writeByte(0)
|
|
..write(obj.type)
|
|
..writeByte(1)
|
|
..write(obj.reverse)
|
|
..writeByte(2)
|
|
..write(obj.id)
|
|
..writeByte(3)
|
|
..write(obj.sourceType);
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is SortingAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|
|
|
|
class ShowAdapter extends TypeAdapter<Show> {
|
|
@override
|
|
final int typeId = 15;
|
|
|
|
@override
|
|
Show read(BinaryReader reader) {
|
|
final numOfFields = reader.readByte();
|
|
final fields = <int, dynamic>{
|
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
|
};
|
|
return Show(
|
|
name: fields[0] as String?,
|
|
description: fields[1] as String?,
|
|
art: fields[2] as DeezerImageDetails?,
|
|
id: fields[3] as String?,
|
|
);
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, Show obj) {
|
|
writer
|
|
..writeByte(4)
|
|
..writeByte(0)
|
|
..write(obj.name)
|
|
..writeByte(1)
|
|
..write(obj.description)
|
|
..writeByte(2)
|
|
..write(obj.art)
|
|
..writeByte(3)
|
|
..write(obj.id);
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is ShowAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|
|
|
|
class AlbumTypeAdapter extends TypeAdapter<AlbumType> {
|
|
@override
|
|
final int typeId = 13;
|
|
|
|
@override
|
|
AlbumType read(BinaryReader reader) {
|
|
switch (reader.readByte()) {
|
|
case 0:
|
|
return AlbumType.ALBUM;
|
|
case 1:
|
|
return AlbumType.SINGLE;
|
|
case 2:
|
|
return AlbumType.FEATURED;
|
|
default:
|
|
return AlbumType.ALBUM;
|
|
}
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, AlbumType obj) {
|
|
switch (obj) {
|
|
case AlbumType.ALBUM:
|
|
writer.writeByte(0);
|
|
break;
|
|
case AlbumType.SINGLE:
|
|
writer.writeByte(1);
|
|
break;
|
|
case AlbumType.FEATURED:
|
|
writer.writeByte(2);
|
|
break;
|
|
}
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is AlbumTypeAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|
|
|
|
class HomePageItemTypeAdapter extends TypeAdapter<HomePageItemType> {
|
|
@override
|
|
final int typeId = 2;
|
|
|
|
@override
|
|
HomePageItemType read(BinaryReader reader) {
|
|
switch (reader.readByte()) {
|
|
case 0:
|
|
return HomePageItemType.SMARTTRACKLIST;
|
|
case 1:
|
|
return HomePageItemType.PLAYLIST;
|
|
case 2:
|
|
return HomePageItemType.ARTIST;
|
|
case 3:
|
|
return HomePageItemType.CHANNEL;
|
|
case 4:
|
|
return HomePageItemType.ALBUM;
|
|
case 5:
|
|
return HomePageItemType.SHOW;
|
|
default:
|
|
return HomePageItemType.SMARTTRACKLIST;
|
|
}
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, HomePageItemType obj) {
|
|
switch (obj) {
|
|
case HomePageItemType.SMARTTRACKLIST:
|
|
writer.writeByte(0);
|
|
break;
|
|
case HomePageItemType.PLAYLIST:
|
|
writer.writeByte(1);
|
|
break;
|
|
case HomePageItemType.ARTIST:
|
|
writer.writeByte(2);
|
|
break;
|
|
case HomePageItemType.CHANNEL:
|
|
writer.writeByte(3);
|
|
break;
|
|
case HomePageItemType.ALBUM:
|
|
writer.writeByte(4);
|
|
break;
|
|
case HomePageItemType.SHOW:
|
|
writer.writeByte(5);
|
|
break;
|
|
}
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is HomePageItemTypeAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|
|
|
|
class HomePageSectionLayoutAdapter extends TypeAdapter<HomePageSectionLayout> {
|
|
@override
|
|
final int typeId = 3;
|
|
|
|
@override
|
|
HomePageSectionLayout read(BinaryReader reader) {
|
|
switch (reader.readByte()) {
|
|
case 0:
|
|
return HomePageSectionLayout.ROW;
|
|
case 1:
|
|
return HomePageSectionLayout.GRID;
|
|
default:
|
|
return HomePageSectionLayout.ROW;
|
|
}
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, HomePageSectionLayout obj) {
|
|
switch (obj) {
|
|
case HomePageSectionLayout.ROW:
|
|
writer.writeByte(0);
|
|
break;
|
|
case HomePageSectionLayout.GRID:
|
|
writer.writeByte(1);
|
|
break;
|
|
}
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is HomePageSectionLayoutAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|
|
|
|
class SortTypeAdapter extends TypeAdapter<SortType> {
|
|
@override
|
|
final int typeId = 18;
|
|
|
|
@override
|
|
SortType read(BinaryReader reader) {
|
|
switch (reader.readByte()) {
|
|
case 0:
|
|
return SortType.DEFAULT;
|
|
case 1:
|
|
return SortType.ALPHABETIC;
|
|
case 2:
|
|
return SortType.ARTIST;
|
|
case 3:
|
|
return SortType.ALBUM;
|
|
case 4:
|
|
return SortType.RELEASE_DATE;
|
|
case 5:
|
|
return SortType.POPULARITY;
|
|
case 6:
|
|
return SortType.USER;
|
|
case 7:
|
|
return SortType.TRACK_COUNT;
|
|
case 8:
|
|
return SortType.DATE_ADDED;
|
|
default:
|
|
return SortType.DEFAULT;
|
|
}
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, SortType obj) {
|
|
switch (obj) {
|
|
case SortType.DEFAULT:
|
|
writer.writeByte(0);
|
|
break;
|
|
case SortType.ALPHABETIC:
|
|
writer.writeByte(1);
|
|
break;
|
|
case SortType.ARTIST:
|
|
writer.writeByte(2);
|
|
break;
|
|
case SortType.ALBUM:
|
|
writer.writeByte(3);
|
|
break;
|
|
case SortType.RELEASE_DATE:
|
|
writer.writeByte(4);
|
|
break;
|
|
case SortType.POPULARITY:
|
|
writer.writeByte(5);
|
|
break;
|
|
case SortType.USER:
|
|
writer.writeByte(6);
|
|
break;
|
|
case SortType.TRACK_COUNT:
|
|
writer.writeByte(7);
|
|
break;
|
|
case SortType.DATE_ADDED:
|
|
writer.writeByte(8);
|
|
break;
|
|
}
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is SortTypeAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|
|
|
|
class SortSourceTypesAdapter extends TypeAdapter<SortSourceTypes> {
|
|
@override
|
|
final int typeId = 19;
|
|
|
|
@override
|
|
SortSourceTypes read(BinaryReader reader) {
|
|
switch (reader.readByte()) {
|
|
case 0:
|
|
return SortSourceTypes.TRACKS;
|
|
case 1:
|
|
return SortSourceTypes.PLAYLISTS;
|
|
case 2:
|
|
return SortSourceTypes.ALBUMS;
|
|
case 3:
|
|
return SortSourceTypes.ARTISTS;
|
|
case 4:
|
|
return SortSourceTypes.PLAYLIST;
|
|
default:
|
|
return SortSourceTypes.TRACKS;
|
|
}
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, SortSourceTypes obj) {
|
|
switch (obj) {
|
|
case SortSourceTypes.TRACKS:
|
|
writer.writeByte(0);
|
|
break;
|
|
case SortSourceTypes.PLAYLISTS:
|
|
writer.writeByte(1);
|
|
break;
|
|
case SortSourceTypes.ALBUMS:
|
|
writer.writeByte(2);
|
|
break;
|
|
case SortSourceTypes.ARTISTS:
|
|
writer.writeByte(3);
|
|
break;
|
|
case SortSourceTypes.PLAYLIST:
|
|
writer.writeByte(4);
|
|
break;
|
|
}
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is SortSourceTypesAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|
|
|
|
class NavigatorRouteTypeAdapter extends TypeAdapter<NavigatorRouteType> {
|
|
@override
|
|
final int typeId = 30;
|
|
|
|
@override
|
|
NavigatorRouteType read(BinaryReader reader) {
|
|
switch (reader.readByte()) {
|
|
case 0:
|
|
return NavigatorRouteType.blur_slide;
|
|
case 1:
|
|
return NavigatorRouteType.fade;
|
|
case 2:
|
|
return NavigatorRouteType.fade_blur;
|
|
case 3:
|
|
return NavigatorRouteType.material;
|
|
case 4:
|
|
return NavigatorRouteType.cupertino;
|
|
default:
|
|
return NavigatorRouteType.blur_slide;
|
|
}
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, NavigatorRouteType obj) {
|
|
switch (obj) {
|
|
case NavigatorRouteType.blur_slide:
|
|
writer.writeByte(0);
|
|
break;
|
|
case NavigatorRouteType.fade:
|
|
writer.writeByte(1);
|
|
break;
|
|
case NavigatorRouteType.fade_blur:
|
|
writer.writeByte(2);
|
|
break;
|
|
case NavigatorRouteType.material:
|
|
writer.writeByte(3);
|
|
break;
|
|
case NavigatorRouteType.cupertino:
|
|
writer.writeByte(4);
|
|
break;
|
|
}
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is NavigatorRouteTypeAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|
|
|
|
// **************************************************************************
|
|
// JsonSerializableGenerator
|
|
// **************************************************************************
|
|
|
|
Track _$TrackFromJson(Map<String, dynamic> json) => Track(
|
|
id: json['id'] as String,
|
|
title: json['title'] as String?,
|
|
duration: json['duration'] == null
|
|
? null
|
|
: Duration(microseconds: json['duration'] as int),
|
|
album: json['album'] == null
|
|
? null
|
|
: Album.fromJson(json['album'] as Map<String, dynamic>),
|
|
playbackDetails: json['playbackDetails'] as List<dynamic>?,
|
|
albumArt: json['albumArt'] == null
|
|
? null
|
|
: DeezerImageDetails.fromJson(
|
|
json['albumArt'] as Map<String, dynamic>),
|
|
artists: (json['artists'] as List<dynamic>?)
|
|
?.map((e) => Artist.fromJson(e as Map<String, dynamic>))
|
|
.toList(),
|
|
trackNumber: json['trackNumber'] as int?,
|
|
offline: json['offline'] as bool?,
|
|
lyrics: json['lyrics'] == null
|
|
? null
|
|
: Lyrics.fromJson(json['lyrics'] as Map<String, dynamic>),
|
|
favorite: json['favorite'] as bool?,
|
|
diskNumber: json['diskNumber'] as int?,
|
|
explicit: json['explicit'] as bool?,
|
|
addedDate: json['addedDate'] as int?,
|
|
);
|
|
|
|
Map<String, dynamic> _$TrackToJson(Track instance) => <String, dynamic>{
|
|
'id': instance.id,
|
|
'title': instance.title,
|
|
'album': instance.album?.toJson(),
|
|
'artists': instance.artists?.map((e) => e.toJson()).toList(),
|
|
'duration': instance.duration?.inMicroseconds,
|
|
'albumArt': instance.albumArt?.toJson(),
|
|
'trackNumber': instance.trackNumber,
|
|
'offline': instance.offline,
|
|
'lyrics': instance.lyrics?.toJson(),
|
|
'favorite': instance.favorite,
|
|
'diskNumber': instance.diskNumber,
|
|
'explicit': instance.explicit,
|
|
'addedDate': instance.addedDate,
|
|
'playbackDetails': instance.playbackDetails,
|
|
};
|
|
|
|
Album _$AlbumFromJson(Map<String, dynamic> json) => Album(
|
|
id: json['id'] as String?,
|
|
title: json['title'] as String?,
|
|
art: json['art'] == null
|
|
? null
|
|
: DeezerImageDetails.fromJson(json['art'] as Map<String, dynamic>),
|
|
artists: (json['artists'] as List<dynamic>?)
|
|
?.map((e) => Artist.fromJson(e as Map<String, dynamic>))
|
|
.toList(),
|
|
tracks: (json['tracks'] as List<dynamic>?)
|
|
?.map((e) => Track.fromJson(e as Map<String, dynamic>))
|
|
.toList(),
|
|
fans: json['fans'] as int?,
|
|
offline: json['offline'] as bool?,
|
|
library: json['library'] as bool?,
|
|
type: $enumDecodeNullable(_$AlbumTypeEnumMap, json['type']),
|
|
releaseDate: json['releaseDate'] as String?,
|
|
favoriteDate: json['favoriteDate'] as String?,
|
|
);
|
|
|
|
Map<String, dynamic> _$AlbumToJson(Album instance) => <String, dynamic>{
|
|
'id': instance.id,
|
|
'title': instance.title,
|
|
'artists': instance.artists?.map((e) => e.toJson()).toList(),
|
|
'tracks': instance.tracks?.map((e) => e.toJson()).toList(),
|
|
'art': instance.art?.toJson(),
|
|
'fans': instance.fans,
|
|
'offline': instance.offline,
|
|
'library': instance.library,
|
|
'type': _$AlbumTypeEnumMap[instance.type],
|
|
'releaseDate': instance.releaseDate,
|
|
'favoriteDate': instance.favoriteDate,
|
|
};
|
|
|
|
const _$AlbumTypeEnumMap = {
|
|
AlbumType.ALBUM: 'ALBUM',
|
|
AlbumType.SINGLE: 'SINGLE',
|
|
AlbumType.FEATURED: 'FEATURED',
|
|
};
|
|
|
|
ArtistHighlight _$ArtistHighlightFromJson(Map<String, dynamic> json) =>
|
|
ArtistHighlight(
|
|
data: json['data'],
|
|
type: $enumDecodeNullable(_$ArtistHighlightTypeEnumMap, json['type']),
|
|
title: json['title'] as String?,
|
|
);
|
|
|
|
Map<String, dynamic> _$ArtistHighlightToJson(ArtistHighlight instance) =>
|
|
<String, dynamic>{
|
|
'data': instance.data,
|
|
'type': _$ArtistHighlightTypeEnumMap[instance.type],
|
|
'title': instance.title,
|
|
};
|
|
|
|
const _$ArtistHighlightTypeEnumMap = {
|
|
ArtistHighlightType.ALBUM: 'ALBUM',
|
|
};
|
|
|
|
Artist _$ArtistFromJson(Map<String, dynamic> json) => Artist(
|
|
id: json['id'] as String,
|
|
name: json['name'] as String?,
|
|
albums: (json['albums'] as List<dynamic>?)
|
|
?.map((e) => Album.fromJson(e as Map<String, dynamic>))
|
|
.toList(),
|
|
albumCount: json['albumCount'] as int?,
|
|
topTracks: (json['topTracks'] as List<dynamic>?)
|
|
?.map((e) => Track.fromJson(e as Map<String, dynamic>))
|
|
.toList(),
|
|
picture: json['picture'] == null
|
|
? null
|
|
: DeezerImageDetails.fromJson(
|
|
json['picture'] as Map<String, dynamic>),
|
|
fans: json['fans'] as int?,
|
|
offline: json['offline'] as bool?,
|
|
library: json['library'] as bool?,
|
|
radio: json['radio'] as bool?,
|
|
favoriteDate: json['favoriteDate'] as String?,
|
|
highlight: json['highlight'] == null
|
|
? null
|
|
: ArtistHighlight.fromJson(json['highlight'] as Map<String, dynamic>),
|
|
);
|
|
|
|
Map<String, dynamic> _$ArtistToJson(Artist instance) => <String, dynamic>{
|
|
'id': instance.id,
|
|
'name': instance.name,
|
|
'albums': instance.albums?.map((e) => e.toJson()).toList(),
|
|
'albumCount': instance.albumCount,
|
|
'topTracks': instance.topTracks?.map((e) => e.toJson()).toList(),
|
|
'picture': instance.picture?.toJson(),
|
|
'fans': instance.fans,
|
|
'offline': instance.offline,
|
|
'library': instance.library,
|
|
'radio': instance.radio,
|
|
'favoriteDate': instance.favoriteDate,
|
|
'highlight': instance.highlight?.toJson(),
|
|
};
|
|
|
|
Playlist _$PlaylistFromJson(Map<String, dynamic> json) => Playlist(
|
|
id: json['id'] as String,
|
|
title: json['title'] as String?,
|
|
tracks: (json['tracks'] as List<dynamic>?)
|
|
?.map((e) => Track.fromJson(e as Map<String, dynamic>))
|
|
.toList(),
|
|
image: _$JsonConverterFromJson<Map<String, dynamic>, ImageDetails>(
|
|
json['image'], const JsonImageDetailsConverter().fromJson),
|
|
trackCount: json['trackCount'] as int?,
|
|
duration: json['duration'] == null
|
|
? null
|
|
: Duration(microseconds: json['duration'] as int),
|
|
user: json['user'] == null
|
|
? null
|
|
: User.fromJson(json['user'] as Map<String, dynamic>),
|
|
fans: json['fans'] as int?,
|
|
library: json['library'] as bool?,
|
|
description: json['description'] as String?,
|
|
);
|
|
|
|
Map<String, dynamic> _$PlaylistToJson(Playlist instance) => <String, dynamic>{
|
|
'id': instance.id,
|
|
'title': instance.title,
|
|
'tracks': instance.tracks?.map((e) => e.toJson()).toList(),
|
|
'image': _$JsonConverterToJson<Map<String, dynamic>, ImageDetails>(
|
|
instance.image, const JsonImageDetailsConverter().toJson),
|
|
'duration': instance.duration?.inMicroseconds,
|
|
'trackCount': instance.trackCount,
|
|
'user': instance.user?.toJson(),
|
|
'fans': instance.fans,
|
|
'library': instance.library,
|
|
'description': instance.description,
|
|
};
|
|
|
|
Value? _$JsonConverterFromJson<Json, Value>(
|
|
Object? json,
|
|
Value? Function(Json json) fromJson,
|
|
) =>
|
|
json == null ? null : fromJson(json as Json);
|
|
|
|
Json? _$JsonConverterToJson<Json, Value>(
|
|
Value? value,
|
|
Json? Function(Value value) toJson,
|
|
) =>
|
|
value == null ? null : toJson(value);
|
|
|
|
User _$UserFromJson(Map<String, dynamic> json) => User(
|
|
id: json['id'] as String?,
|
|
name: json['name'] as String?,
|
|
picture: json['picture'] == null
|
|
? null
|
|
: DeezerImageDetails.fromJson(
|
|
json['picture'] as Map<String, dynamic>),
|
|
);
|
|
|
|
Map<String, dynamic> _$UserToJson(User instance) => <String, dynamic>{
|
|
'id': instance.id,
|
|
'name': instance.name,
|
|
'picture': instance.picture?.toJson(),
|
|
};
|
|
|
|
UrlImageDetails _$UrlImageDetailsFromJson(Map<String, dynamic> json) =>
|
|
UrlImageDetails(
|
|
full: json['full'] as String,
|
|
thumb: json['thumb'] as String,
|
|
);
|
|
|
|
Map<String, dynamic> _$UrlImageDetailsToJson(UrlImageDetails instance) =>
|
|
<String, dynamic>{
|
|
'full': instance.full,
|
|
'thumb': instance.thumb,
|
|
};
|
|
|
|
DeezerImageDetails _$DeezerImageDetailsFromJson(Map<String, dynamic> json) =>
|
|
DeezerImageDetails(
|
|
json['md5'] as String,
|
|
type: json['type'] as String? ?? 'cover',
|
|
);
|
|
|
|
Map<String, dynamic> _$DeezerImageDetailsToJson(DeezerImageDetails instance) =>
|
|
<String, dynamic>{
|
|
'type': instance.type,
|
|
'md5': instance.md5,
|
|
};
|
|
|
|
Lyrics _$LyricsFromJson(Map<String, dynamic> json) => Lyrics(
|
|
id: json['id'] as String?,
|
|
writers: json['writers'] as String?,
|
|
lyrics: (json['lyrics'] as List<dynamic>?)
|
|
?.map((e) => Lyric.fromJson(e as Map<String, dynamic>))
|
|
.toList(),
|
|
sync: json['sync'] as bool? ?? true,
|
|
);
|
|
|
|
Map<String, dynamic> _$LyricsToJson(Lyrics instance) => <String, dynamic>{
|
|
'id': instance.id,
|
|
'writers': instance.writers,
|
|
'lyrics': instance.lyrics?.map((e) => e.toJson()).toList(),
|
|
'sync': instance.sync,
|
|
};
|
|
|
|
Lyric _$LyricFromJson(Map<String, dynamic> json) => Lyric(
|
|
offset: json['offset'] == null
|
|
? null
|
|
: Duration(microseconds: json['offset'] as int),
|
|
text: json['text'] as String?,
|
|
lrcTimestamp: json['lrcTimestamp'] as String?,
|
|
);
|
|
|
|
Map<String, dynamic> _$LyricToJson(Lyric instance) => <String, dynamic>{
|
|
'offset': instance.offset?.inMicroseconds,
|
|
'text': instance.text,
|
|
'lrcTimestamp': instance.lrcTimestamp,
|
|
};
|
|
|
|
QueueSource _$QueueSourceFromJson(Map<String, dynamic> json) => QueueSource(
|
|
id: json['id'] as String?,
|
|
text: json['text'] as String?,
|
|
source: json['source'] as String?,
|
|
);
|
|
|
|
Map<String, dynamic> _$QueueSourceToJson(QueueSource instance) =>
|
|
<String, dynamic>{
|
|
'id': instance.id,
|
|
'text': instance.text,
|
|
'source': instance.source,
|
|
};
|
|
|
|
SmartTrackList _$SmartTrackListFromJson(Map<String, dynamic> json) =>
|
|
SmartTrackList(
|
|
id: json['id'] as String?,
|
|
title: json['title'] as String?,
|
|
description: json['description'] as String?,
|
|
trackCount: json['trackCount'] as int?,
|
|
tracks: (json['tracks'] as List<dynamic>?)
|
|
?.map((e) => Track.fromJson(e as Map<String, dynamic>))
|
|
.toList(),
|
|
cover: (json['cover'] as List<dynamic>?)
|
|
?.map((e) => DeezerImageDetails.fromJson(e as Map<String, dynamic>))
|
|
.toList(),
|
|
subtitle: json['subtitle'] as String?,
|
|
flowConfig: SmartTrackList._configFromJson(json['flowConfig'] as String),
|
|
);
|
|
|
|
Map<String, dynamic> _$SmartTrackListToJson(SmartTrackList instance) =>
|
|
<String, dynamic>{
|
|
'id': instance.id,
|
|
'title': instance.title,
|
|
'subtitle': instance.subtitle,
|
|
'description': instance.description,
|
|
'trackCount': instance.trackCount,
|
|
'tracks': instance.tracks?.map((e) => e.toJson()).toList(),
|
|
'cover': instance.cover?.map((e) => e.toJson()).toList(),
|
|
'flowConfig': instance.flowConfig,
|
|
};
|
|
|
|
HomePage _$HomePageFromJson(Map<String, dynamic> json) => HomePage(
|
|
sections: (json['sections'] as List<dynamic>)
|
|
.map((e) => HomePageSection.fromJson(e as Map<String, dynamic>))
|
|
.toList(),
|
|
lastUpdated: json['lastUpdated'] == null
|
|
? null
|
|
: DateTime.parse(json['lastUpdated'] as String),
|
|
);
|
|
|
|
Map<String, dynamic> _$HomePageToJson(HomePage instance) => <String, dynamic>{
|
|
'sections': instance.sections.map((e) => e.toJson()).toList(),
|
|
'lastUpdated': instance.lastUpdated.toIso8601String(),
|
|
};
|
|
|
|
HomePageSection _$HomePageSectionFromJson(Map<String, dynamic> json) =>
|
|
HomePageSection(
|
|
layout: $enumDecode(_$HomePageSectionLayoutEnumMap, json['layout']),
|
|
items: HomePageSection._homePageItemFromJson(json['items']),
|
|
title: json['title'] as String?,
|
|
pagePath: json['pagePath'] as String?,
|
|
hasMore: json['hasMore'] as bool?,
|
|
);
|
|
|
|
Map<String, dynamic> _$HomePageSectionToJson(HomePageSection instance) =>
|
|
<String, dynamic>{
|
|
'title': instance.title,
|
|
'layout': _$HomePageSectionLayoutEnumMap[instance.layout]!,
|
|
'pagePath': instance.pagePath,
|
|
'hasMore': instance.hasMore,
|
|
'items': HomePageSection._homePageItemToJson(instance.items),
|
|
};
|
|
|
|
const _$HomePageSectionLayoutEnumMap = {
|
|
HomePageSectionLayout.ROW: 'ROW',
|
|
HomePageSectionLayout.GRID: 'GRID',
|
|
};
|
|
|
|
DeezerChannel _$DeezerChannelFromJson(Map<String, dynamic> json) =>
|
|
DeezerChannel(
|
|
id: json['id'] as String?,
|
|
title: json['title'] as String?,
|
|
backgroundColor: json['backgroundColor'] == null
|
|
? Colors.blue
|
|
: DeezerChannel._colorFromJson(json['backgroundColor'] as int),
|
|
target: json['target'] as String?,
|
|
logo: json['logo'] == null
|
|
? null
|
|
: DeezerImageDetails.fromJson(json['logo'] as Map<String, dynamic>),
|
|
picture: json['picture'] == null
|
|
? null
|
|
: DeezerImageDetails.fromJson(
|
|
json['picture'] as Map<String, dynamic>),
|
|
);
|
|
|
|
Map<String, dynamic> _$DeezerChannelToJson(DeezerChannel instance) =>
|
|
<String, dynamic>{
|
|
'id': instance.id,
|
|
'target': instance.target,
|
|
'title': instance.title,
|
|
'backgroundColor': DeezerChannel._colorToJson(instance.backgroundColor),
|
|
'logo': instance.logo?.toJson(),
|
|
'picture': instance.picture?.toJson(),
|
|
};
|
|
|
|
Sorting _$SortingFromJson(Map<String, dynamic> json) => Sorting(
|
|
type: $enumDecodeNullable(_$SortTypeEnumMap, json['type']) ??
|
|
SortType.DEFAULT,
|
|
reverse: json['reverse'] as bool? ?? false,
|
|
id: json['id'] as String?,
|
|
sourceType:
|
|
$enumDecodeNullable(_$SortSourceTypesEnumMap, json['sourceType']),
|
|
);
|
|
|
|
Map<String, dynamic> _$SortingToJson(Sorting instance) => <String, dynamic>{
|
|
'type': _$SortTypeEnumMap[instance.type],
|
|
'reverse': instance.reverse,
|
|
'id': instance.id,
|
|
'sourceType': _$SortSourceTypesEnumMap[instance.sourceType],
|
|
};
|
|
|
|
const _$SortTypeEnumMap = {
|
|
SortType.DEFAULT: 'DEFAULT',
|
|
SortType.ALPHABETIC: 'ALPHABETIC',
|
|
SortType.ARTIST: 'ARTIST',
|
|
SortType.ALBUM: 'ALBUM',
|
|
SortType.RELEASE_DATE: 'RELEASE_DATE',
|
|
SortType.POPULARITY: 'POPULARITY',
|
|
SortType.USER: 'USER',
|
|
SortType.TRACK_COUNT: 'TRACK_COUNT',
|
|
SortType.DATE_ADDED: 'DATE_ADDED',
|
|
};
|
|
|
|
const _$SortSourceTypesEnumMap = {
|
|
SortSourceTypes.TRACKS: 'TRACKS',
|
|
SortSourceTypes.PLAYLISTS: 'PLAYLISTS',
|
|
SortSourceTypes.ALBUMS: 'ALBUMS',
|
|
SortSourceTypes.ARTISTS: 'ARTISTS',
|
|
SortSourceTypes.PLAYLIST: 'PLAYLIST',
|
|
};
|
|
|
|
Show _$ShowFromJson(Map<String, dynamic> json) => Show(
|
|
name: json['name'] as String?,
|
|
description: json['description'] as String?,
|
|
art: json['art'] == null
|
|
? null
|
|
: DeezerImageDetails.fromJson(json['art'] as Map<String, dynamic>),
|
|
id: json['id'] as String?,
|
|
);
|
|
|
|
Map<String, dynamic> _$ShowToJson(Show instance) => <String, dynamic>{
|
|
'name': instance.name,
|
|
'description': instance.description,
|
|
'art': instance.art?.toJson(),
|
|
'id': instance.id,
|
|
};
|
|
|
|
ShowEpisode _$ShowEpisodeFromJson(Map<String, dynamic> json) => ShowEpisode(
|
|
id: json['id'] as String?,
|
|
title: json['title'] as String?,
|
|
description: json['description'] as String?,
|
|
url: json['url'] as String?,
|
|
duration: json['duration'] == null
|
|
? null
|
|
: Duration(microseconds: json['duration'] as int),
|
|
publishedDate: json['publishedDate'] as String?,
|
|
show: json['show'] == null
|
|
? null
|
|
: Show.fromJson(json['show'] as Map<String, dynamic>),
|
|
);
|
|
|
|
Map<String, dynamic> _$ShowEpisodeToJson(ShowEpisode instance) =>
|
|
<String, dynamic>{
|
|
'id': instance.id,
|
|
'title': instance.title,
|
|
'description': instance.description,
|
|
'url': instance.url,
|
|
'duration': instance.duration?.inMicroseconds,
|
|
'publishedDate': instance.publishedDate,
|
|
'show': instance.show?.toJson(),
|
|
};
|
|
|
|
StreamQualityInfo _$StreamQualityInfoFromJson(Map<String, dynamic> json) =>
|
|
StreamQualityInfo(
|
|
format: $enumDecode(_$FormatEnumMap, json['format']),
|
|
source: $enumDecode(_$SourceEnumMap, json['source']),
|
|
quality: $enumDecodeNullable(_$AudioQualityEnumMap, json['quality']),
|
|
size: json['size'] as int?,
|
|
);
|
|
|
|
Map<String, dynamic> _$StreamQualityInfoToJson(StreamQualityInfo instance) =>
|
|
<String, dynamic>{
|
|
'format': _$FormatEnumMap[instance.format]!,
|
|
'size': instance.size,
|
|
'quality': _$AudioQualityEnumMap[instance.quality],
|
|
'source': _$SourceEnumMap[instance.source]!,
|
|
};
|
|
|
|
const _$FormatEnumMap = {
|
|
Format.MP3: 'MP3',
|
|
Format.FLAC: 'FLAC',
|
|
};
|
|
|
|
const _$SourceEnumMap = {
|
|
Source.offline: 'offline',
|
|
Source.stream: 'stream',
|
|
};
|
|
|
|
const _$AudioQualityEnumMap = {
|
|
AudioQuality.MP3_128: 'MP3_128',
|
|
AudioQuality.MP3_320: 'MP3_320',
|
|
AudioQuality.FLAC: 'FLAC',
|
|
AudioQuality.ASK: 'ASK',
|
|
};
|