// GENERATED CODE - DO NOT MODIFY BY HAND part of 'definitions.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** Track _$TrackFromJson(Map json) { return 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), playbackDetails: json['playbackDetails'] as List, albumArt: json['albumArt'] == null ? null : ImageDetails.fromJson(json['albumArt'] as Map), artists: (json['artists'] as List) ?.map((e) => e == null ? null : Artist.fromJson(e as Map)) ?.toList(), trackNumber: json['trackNumber'] as int, offline: json['offline'] as bool, lyrics: json['lyrics'] == null ? null : Lyrics.fromJson(json['lyrics'] as Map), favorite: json['favorite'] as bool, diskNumber: json['diskNumber'] as int, explicit: json['explicit'] as bool, ); } Map _$TrackToJson(Track instance) => { 'id': instance.id, 'title': instance.title, 'album': instance.album, 'artists': instance.artists, 'duration': instance.duration?.inMicroseconds, 'albumArt': instance.albumArt, 'trackNumber': instance.trackNumber, 'offline': instance.offline, 'lyrics': instance.lyrics, 'favorite': instance.favorite, 'diskNumber': instance.diskNumber, 'explicit': instance.explicit, 'playbackDetails': instance.playbackDetails, }; Album _$AlbumFromJson(Map json) { return Album( id: json['id'] as String, title: json['title'] as String, art: json['art'] == null ? null : ImageDetails.fromJson(json['art'] as Map), artists: (json['artists'] as List) ?.map((e) => e == null ? null : Artist.fromJson(e as Map)) ?.toList(), tracks: (json['tracks'] as List) ?.map( (e) => e == null ? null : Track.fromJson(e as Map)) ?.toList(), fans: json['fans'] as int, offline: json['offline'] as bool, library: json['library'] as bool, type: _$enumDecodeNullable(_$AlbumTypeEnumMap, json['type']), ); } Map _$AlbumToJson(Album instance) => { 'id': instance.id, 'title': instance.title, 'artists': instance.artists, 'tracks': instance.tracks, 'art': instance.art, 'fans': instance.fans, 'offline': instance.offline, 'library': instance.library, 'type': _$AlbumTypeEnumMap[instance.type], }; T _$enumDecode( Map enumValues, dynamic source, { T unknownValue, }) { if (source == null) { throw ArgumentError('A value must be provided. Supported values: ' '${enumValues.values.join(', ')}'); } final value = enumValues.entries .singleWhere((e) => e.value == source, orElse: () => null) ?.key; if (value == null && unknownValue == null) { throw ArgumentError('`$source` is not one of the supported values: ' '${enumValues.values.join(', ')}'); } return value ?? unknownValue; } T _$enumDecodeNullable( Map enumValues, dynamic source, { T unknownValue, }) { if (source == null) { return null; } return _$enumDecode(enumValues, source, unknownValue: unknownValue); } const _$AlbumTypeEnumMap = { AlbumType.ALBUM: 'ALBUM', AlbumType.SINGLE: 'SINGLE', AlbumType.FEATURED: 'FEATURED', }; Artist _$ArtistFromJson(Map json) { return Artist( id: json['id'] as String, name: json['name'] as String, albums: (json['albums'] as List) ?.map( (e) => e == null ? null : Album.fromJson(e as Map)) ?.toList(), albumCount: json['albumCount'] as int, topTracks: (json['topTracks'] as List) ?.map( (e) => e == null ? null : Track.fromJson(e as Map)) ?.toList(), picture: json['picture'] == null ? null : ImageDetails.fromJson(json['picture'] as Map), fans: json['fans'] as int, offline: json['offline'] as bool, library: json['library'] as bool, ); } Map _$ArtistToJson(Artist instance) => { 'id': instance.id, 'name': instance.name, 'albums': instance.albums, 'albumCount': instance.albumCount, 'topTracks': instance.topTracks, 'picture': instance.picture, 'fans': instance.fans, 'offline': instance.offline, 'library': instance.library, }; Playlist _$PlaylistFromJson(Map json) { return Playlist( id: json['id'] as String, title: json['title'] as String, tracks: (json['tracks'] as List) ?.map( (e) => e == null ? null : Track.fromJson(e as Map)) ?.toList(), image: json['image'] == null ? null : ImageDetails.fromJson(json['image'] as Map), 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), fans: json['fans'] as int, library: json['library'] as bool, description: json['description'] as String, ); } Map _$PlaylistToJson(Playlist instance) => { 'id': instance.id, 'title': instance.title, 'tracks': instance.tracks, 'image': instance.image, 'duration': instance.duration?.inMicroseconds, 'trackCount': instance.trackCount, 'user': instance.user, 'fans': instance.fans, 'library': instance.library, 'description': instance.description, }; User _$UserFromJson(Map json) { return User( id: json['id'] as String, name: json['name'] as String, picture: json['picture'] == null ? null : ImageDetails.fromJson(json['picture'] as Map), ); } Map _$UserToJson(User instance) => { 'id': instance.id, 'name': instance.name, 'picture': instance.picture, }; ImageDetails _$ImageDetailsFromJson(Map json) { return ImageDetails( fullUrl: json['fullUrl'] as String, thumbUrl: json['thumbUrl'] as String, ); } Map _$ImageDetailsToJson(ImageDetails instance) => { 'fullUrl': instance.fullUrl, 'thumbUrl': instance.thumbUrl, }; Lyrics _$LyricsFromJson(Map json) { return Lyrics( id: json['id'] as String, writers: json['writers'] as String, lyrics: (json['lyrics'] as List) ?.map( (e) => e == null ? null : Lyric.fromJson(e as Map)) ?.toList(), ); } Map _$LyricsToJson(Lyrics instance) => { 'id': instance.id, 'writers': instance.writers, 'lyrics': instance.lyrics, }; Lyric _$LyricFromJson(Map json) { return Lyric( offset: json['offset'] == null ? null : Duration(microseconds: json['offset'] as int), text: json['text'] as String, lrcTimestamp: json['lrcTimestamp'] as String, ); } Map _$LyricToJson(Lyric instance) => { 'offset': instance.offset?.inMicroseconds, 'text': instance.text, 'lrcTimestamp': instance.lrcTimestamp, }; QueueSource _$QueueSourceFromJson(Map json) { return QueueSource( id: json['id'] as String, text: json['text'] as String, source: json['source'] as String, ); } Map _$QueueSourceToJson(QueueSource instance) => { 'id': instance.id, 'text': instance.text, 'source': instance.source, }; SmartTrackList _$SmartTrackListFromJson(Map json) { return 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) ?.map( (e) => e == null ? null : Track.fromJson(e as Map)) ?.toList(), cover: json['cover'] == null ? null : ImageDetails.fromJson(json['cover'] as Map), subtitle: json['subtitle'] as String, ); } Map _$SmartTrackListToJson(SmartTrackList instance) => { 'id': instance.id, 'title': instance.title, 'subtitle': instance.subtitle, 'description': instance.description, 'trackCount': instance.trackCount, 'tracks': instance.tracks, 'cover': instance.cover, }; HomePage _$HomePageFromJson(Map json) { return HomePage( sections: (json['sections'] as List) ?.map((e) => e == null ? null : HomePageSection.fromJson(e as Map)) ?.toList(), ); } Map _$HomePageToJson(HomePage instance) => { 'sections': instance.sections, }; HomePageSection _$HomePageSectionFromJson(Map json) { return HomePageSection( layout: _$enumDecodeNullable(_$HomePageSectionLayoutEnumMap, json['layout']), items: HomePageSection._homePageItemFromJson(json['items']), title: json['title'] as String, pagePath: json['pagePath'] as String, hasMore: json['hasMore'] as bool, ); } Map _$HomePageSectionToJson(HomePageSection instance) => { 'title': instance.title, 'layout': _$HomePageSectionLayoutEnumMap[instance.layout], 'pagePath': instance.pagePath, 'hasMore': instance.hasMore, 'items': HomePageSection._homePageItemToJson(instance.items), }; const _$HomePageSectionLayoutEnumMap = { HomePageSectionLayout.ROW: 'ROW', }; DeezerChannel _$DeezerChannelFromJson(Map json) { return DeezerChannel( id: json['id'] as String, title: json['title'] as String, backgroundColor: DeezerChannel._colorFromJson(json['backgroundColor'] as int), target: json['target'] as String, ); } Map _$DeezerChannelToJson(DeezerChannel instance) => { 'id': instance.id, 'target': instance.target, 'title': instance.title, 'backgroundColor': DeezerChannel._colorToJson(instance.backgroundColor), };