// GENERATED CODE - DO NOT MODIFY BY HAND part of 'definitions.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** Track _$TrackFromJson(Map 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), playbackDetails: json['playbackDetails'] as List?, albumArt: json['albumArt'] == null ? null : ImageDetails.fromJson(json['albumArt'] as Map), artists: (json['artists'] as List?) ?.map((e) => 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?, addedDate: json['addedDate'] as int?, ); 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, 'addedDate': instance.addedDate, 'playbackDetails': instance.playbackDetails, }; Album _$AlbumFromJson(Map json) => 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) => Artist.fromJson(e as Map)) .toList(), tracks: (json['tracks'] as List?) ?.map((e) => 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']), releaseDate: json['releaseDate'] as String?, favoriteDate: json['favoriteDate'] as String?, ); 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], 'releaseDate': instance.releaseDate, 'favoriteDate': instance.favoriteDate, }; K _$enumDecode( Map enumValues, Object? source, { K? unknownValue, }) { if (source == null) { throw ArgumentError( 'A value must be provided. Supported values: ' '${enumValues.values.join(', ')}', ); } return enumValues.entries.singleWhere( (e) => e.value == source, orElse: () { if (unknownValue == null) { throw ArgumentError( '`$source` is not one of the supported values: ' '${enumValues.values.join(', ')}', ); } return MapEntry(unknownValue, enumValues.values.first); }, ).key; } K? _$enumDecodeNullable( Map enumValues, dynamic source, { K? unknownValue, }) { if (source == null) { return null; } return _$enumDecode(enumValues, source, unknownValue: unknownValue); } const _$AlbumTypeEnumMap = { AlbumType.ALBUM: 'ALBUM', AlbumType.SINGLE: 'SINGLE', AlbumType.FEATURED: 'FEATURED', }; ArtistHighlight _$ArtistHighlightFromJson(Map json) => ArtistHighlight( data: json['data'], type: _$enumDecodeNullable(_$ArtistHighlightTypeEnumMap, json['type']), title: json['title'] as String?, ); Map _$ArtistHighlightToJson(ArtistHighlight instance) => { 'data': instance.data, 'type': _$ArtistHighlightTypeEnumMap[instance.type], 'title': instance.title, }; const _$ArtistHighlightTypeEnumMap = { ArtistHighlightType.ALBUM: 'ALBUM', }; Artist _$ArtistFromJson(Map json) => Artist( id: json['id'] as String?, name: json['name'] as String?, albums: (json['albums'] as List?) ?.map((e) => Album.fromJson(e as Map)) .toList(), albumCount: json['albumCount'] as int?, topTracks: (json['topTracks'] as List?) ?.map((e) => 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?, radio: json['radio'] as bool?, favoriteDate: json['favoriteDate'] as String?, highlight: json['highlight'] == null ? null : ArtistHighlight.fromJson(json['highlight'] as Map), ); 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, 'radio': instance.radio, 'favoriteDate': instance.favoriteDate, 'highlight': instance.highlight, }; Playlist _$PlaylistFromJson(Map json) => Playlist( id: json['id'] as String?, title: json['title'] as String?, tracks: (json['tracks'] as List?) ?.map((e) => 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) => 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) => 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) => Lyrics( id: json['id'] as String?, writers: json['writers'] as String?, lyrics: (json['lyrics'] as List?) ?.map((e) => Lyric.fromJson(e as Map)) .toList(), ); Map _$LyricsToJson(Lyrics instance) => { 'id': instance.id, 'writers': instance.writers, 'lyrics': instance.lyrics, }; Lyric _$LyricFromJson(Map json) => 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) => 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) => 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) => 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) => HomePage( sections: (json['sections'] as List?) ?.map((e) => HomePageSection.fromJson(e as Map)) .toList(), ); Map _$HomePageToJson(HomePage instance) => { 'sections': instance.sections, }; HomePageSection _$HomePageSectionFromJson(Map json) => 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', HomePageSectionLayout.GRID: 'GRID', }; DeezerChannel _$DeezerChannelFromJson(Map 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?, ); Map _$DeezerChannelToJson(DeezerChannel instance) => { 'id': instance.id, 'target': instance.target, 'title': instance.title, 'backgroundColor': DeezerChannel._colorToJson(instance.backgroundColor), }; Sorting _$SortingFromJson(Map 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 _$SortingToJson(Sorting instance) => { '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 json) => Show( name: json['name'] as String?, description: json['description'] as String?, art: json['art'] == null ? null : ImageDetails.fromJson(json['art'] as Map), id: json['id'] as String?, ); Map _$ShowToJson(Show instance) => { 'name': instance.name, 'description': instance.description, 'art': instance.art, 'id': instance.id, }; ShowEpisode _$ShowEpisodeFromJson(Map 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), ); Map _$ShowEpisodeToJson(ShowEpisode instance) => { 'id': instance.id, 'title': instance.title, 'description': instance.description, 'url': instance.url, 'duration': instance.duration?.inMicroseconds, 'publishedDate': instance.publishedDate, 'show': instance.show, };