89 lines
3 KiB
Dart
89 lines
3 KiB
Dart
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||
|
|
||
|
part of 'spotify_track.dart';
|
||
|
|
||
|
// **************************************************************************
|
||
|
// JsonSerializableGenerator
|
||
|
// **************************************************************************
|
||
|
|
||
|
SpotifyTrack _$SpotifyTrackFromJson(Map<String, dynamic> json) => SpotifyTrack(
|
||
|
id: json['id'] as String,
|
||
|
name: json['name'] as String,
|
||
|
artists:
|
||
|
(json['artists'] as List<dynamic>)
|
||
|
.map((e) => SpotifyArtist.fromJson(e as Map<String, dynamic>))
|
||
|
.toList(),
|
||
|
album: SpotifyAlbum.fromJson(json['album'] as Map<String, dynamic>),
|
||
|
durationMs: (json['duration_ms'] as num).toInt(),
|
||
|
externalUrls: Map<String, String>.from(json['external_urls'] as Map),
|
||
|
previewUrl: json['preview_url'] as String?,
|
||
|
);
|
||
|
|
||
|
Map<String, dynamic> _$SpotifyTrackToJson(SpotifyTrack instance) =>
|
||
|
<String, dynamic>{
|
||
|
'id': instance.id,
|
||
|
'name': instance.name,
|
||
|
'artists': instance.artists,
|
||
|
'album': instance.album,
|
||
|
'duration_ms': instance.durationMs,
|
||
|
'external_urls': instance.externalUrls,
|
||
|
'preview_url': instance.previewUrl,
|
||
|
};
|
||
|
|
||
|
SpotifyArtist _$SpotifyArtistFromJson(Map<String, dynamic> json) =>
|
||
|
SpotifyArtist(id: json['id'] as String, name: json['name'] as String);
|
||
|
|
||
|
Map<String, dynamic> _$SpotifyArtistToJson(SpotifyArtist instance) =>
|
||
|
<String, dynamic>{'id': instance.id, 'name': instance.name};
|
||
|
|
||
|
SpotifyAlbum _$SpotifyAlbumFromJson(Map<String, dynamic> json) => SpotifyAlbum(
|
||
|
id: json['id'] as String,
|
||
|
name: json['name'] as String,
|
||
|
images:
|
||
|
(json['images'] as List<dynamic>)
|
||
|
.map((e) => SpotifyImage.fromJson(e as Map<String, dynamic>))
|
||
|
.toList(),
|
||
|
);
|
||
|
|
||
|
Map<String, dynamic> _$SpotifyAlbumToJson(SpotifyAlbum instance) =>
|
||
|
<String, dynamic>{
|
||
|
'id': instance.id,
|
||
|
'name': instance.name,
|
||
|
'images': instance.images,
|
||
|
};
|
||
|
|
||
|
SpotifyImage _$SpotifyImageFromJson(Map<String, dynamic> json) => SpotifyImage(
|
||
|
height: (json['height'] as num).toInt(),
|
||
|
width: (json['width'] as num).toInt(),
|
||
|
url: json['url'] as String,
|
||
|
);
|
||
|
|
||
|
Map<String, dynamic> _$SpotifyImageToJson(SpotifyImage instance) =>
|
||
|
<String, dynamic>{
|
||
|
'height': instance.height,
|
||
|
'width': instance.width,
|
||
|
'url': instance.url,
|
||
|
};
|
||
|
|
||
|
SpotifySearchResponse _$SpotifySearchResponseFromJson(
|
||
|
Map<String, dynamic> json,
|
||
|
) => SpotifySearchResponse(
|
||
|
tracks: SpotifyTracks.fromJson(json['tracks'] as Map<String, dynamic>),
|
||
|
);
|
||
|
|
||
|
Map<String, dynamic> _$SpotifySearchResponseToJson(
|
||
|
SpotifySearchResponse instance,
|
||
|
) => <String, dynamic>{'tracks': instance.tracks};
|
||
|
|
||
|
SpotifyTracks _$SpotifyTracksFromJson(Map<String, dynamic> json) =>
|
||
|
SpotifyTracks(
|
||
|
items:
|
||
|
(json['items'] as List<dynamic>)
|
||
|
.map((e) => SpotifyTrack.fromJson(e as Map<String, dynamic>))
|
||
|
.toList(),
|
||
|
total: (json['total'] as num).toInt(),
|
||
|
);
|
||
|
|
||
|
Map<String, dynamic> _$SpotifyTracksToJson(SpotifyTracks instance) =>
|
||
|
<String, dynamic>{'items': instance.items, 'total': instance.total};
|