-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
179 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
import 'package:json_annotation/json_annotation.dart'; | ||
|
||
part 'spotify_friends.g.dart'; | ||
|
||
@JsonSerializable(createToJson: false) | ||
class SpotifyFriend { | ||
final String uri; | ||
final String name; | ||
final String imageUrl; | ||
|
||
const SpotifyFriend({ | ||
required this.uri, | ||
required this.name, | ||
required this.imageUrl, | ||
}); | ||
|
||
factory SpotifyFriend.fromJson(Map<String, dynamic> json) => | ||
_$SpotifyFriendFromJson(json); | ||
} | ||
|
||
@JsonSerializable(createToJson: false) | ||
class SpotifyActivityArtist { | ||
final String uri; | ||
final String name; | ||
|
||
const SpotifyActivityArtist({required this.uri, required this.name}); | ||
|
||
factory SpotifyActivityArtist.fromJson(Map<String, dynamic> json) => | ||
_$SpotifyActivityArtistFromJson(json); | ||
} | ||
|
||
@JsonSerializable(createToJson: false) | ||
class SpotifyActivityAlbum { | ||
final String uri; | ||
final String name; | ||
|
||
const SpotifyActivityAlbum({required this.uri, required this.name}); | ||
|
||
factory SpotifyActivityAlbum.fromJson(Map<String, dynamic> json) => | ||
_$SpotifyActivityAlbumFromJson(json); | ||
} | ||
|
||
@JsonSerializable(createToJson: false) | ||
class SpotifyActivityContext { | ||
final String uri; | ||
final String name; | ||
final num index; | ||
|
||
const SpotifyActivityContext({ | ||
required this.uri, | ||
required this.name, | ||
required this.index, | ||
}); | ||
|
||
factory SpotifyActivityContext.fromJson(Map<String, dynamic> json) => | ||
_$SpotifyActivityContextFromJson(json); | ||
} | ||
|
||
@JsonSerializable(createToJson: false) | ||
class SpotifyActivityTrack { | ||
final String uri; | ||
final String name; | ||
final String imageUrl; | ||
final SpotifyActivityArtist artist; | ||
final SpotifyActivityAlbum album; | ||
final SpotifyActivityContext context; | ||
|
||
const SpotifyActivityTrack({ | ||
required this.uri, | ||
required this.name, | ||
required this.imageUrl, | ||
required this.artist, | ||
required this.album, | ||
required this.context, | ||
}); | ||
|
||
factory SpotifyActivityTrack.fromJson(Map<String, dynamic> json) => | ||
_$SpotifyActivityTrackFromJson(json); | ||
} | ||
|
||
@JsonSerializable(createToJson: false) | ||
class SpotifyFriendActivity { | ||
SpotifyFriend user; | ||
SpotifyActivityTrack track; | ||
|
||
SpotifyFriendActivity({required this.user, required this.track}); | ||
|
||
factory SpotifyFriendActivity.fromJson(Map<String, dynamic> json) => | ||
_$SpotifyFriendActivityFromJson(json); | ||
} | ||
|
||
@JsonSerializable(createToJson: false) | ||
class SpotifyFriends { | ||
List<SpotifyFriendActivity> friends; | ||
|
||
SpotifyFriends({required this.friends}); | ||
|
||
factory SpotifyFriends.fromJson(Map<String, dynamic> json) => | ||
_$SpotifyFriendsFromJson(json); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters