artist method
Gets data for a specific artist given is id (artistId
).
Example: {@tool snippet}
Genius genius = Genius(accessToken: TOKEN);
Map<String, dynamic>? artist = await genius.artist(artistId: 45);
if (artist != null) {
print(artist['name']);
}
{@end-tool}
Implementation
Future<Map<String, dynamic>?> artist({required int artistId}) async {
return (await _request(
uri:
'https://api.genius.com/artists/$artistId?text_format=plain&access_token=$accessToken'))?[
'artist'];
}