/
main.dart
41 lines (33 loc) · 987 Bytes
/
main.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import 'package:genius_lyrics/genius_lyrics.dart';
void main(List<String> args) async {
Genius genius = Genius(
accessToken:
"au3tufuJPmdCAk5QHCKA3YHTPV8ui4-qsyhHSnBqYkvlZY-WLRlLMbPqf8USG8Ty",
);
Artist? artist = await genius.searchArtist(
artistName: 'Eminem',
maxSongs: 5,
sort: SongsSorting.release_date,
includeFeatures: true,
);
if (artist != null) {
for (var song in artist.songs) {
print(song.title);
}
}
Album? album =
(await genius.searchAlbum(name: 'The Off-Season', artist: 'J.Cole'));
album?.saveLyrics(destPath: 'D:/Desktop/test');
if (album != null) {
print(album.tracks.length);
for (var track in album.tracks) {
print(track.title);
}
}
List<Song> hits = await genius.searchArtistMostPopularSongs(
artistName: 'J. Cole', includeLyrics: true);
Song? song = (await genius.searchSong(artist: 'J. Cole', title: 'KOD'));
if (song != null) {
print(song.lyrics);
}
}