Please share the changes you had made in flute_music_player plugin
Closed this issue ยท 9 comments
avirias commented
like the function toMap()
amangautam1 commented
I had made few changes to the original library to match the app needs. The updated class Song is as below.
class Song {
int id;
String artist;
String title;
String album;
int albumId;
int duration;
String uri;
String albumArt;
int isFav=0;
int timestamp=0;
int count=0;
Song(this.id, this.artist, this.title, this.album, this.albumId,
this.duration, this.uri, this.albumArt,{this.isFav=0,this.timestamp=0,this.count=0});
Song.fromMap(Map m) {
id = m["id"];
artist = m["artist"];
title = m["title"];
album = m["album"];
albumId = m["albumId"];
duration = m["duration"];
uri = m["uri"];
albumArt = m["albumArt"];
isFav=m["isFav"];
timestamp=m["timestamp"];
count=m["count"];
}
static final Columns=["id","artist", "title", "album", "albumId", "duration", "uri", "albumArt","isFav","timestamp"];
Map toMap(){
Map<String,dynamic> map={
"id":id,
"artist":artist,
"title":title,
"album":album,
"albumId":albumId,
"duration":duration,
"uri":uri,
"albumArt":albumArt,
"isFav":isFav,
"timestamp":timestamp,
"count":count,
};
return map;
}
}
avirias commented
thanks @amangautam1
Nimto007 commented
amangautam1 commented
Nimto007 commented
Thanks you,
minguibernardo commented
Thanks
Aakash-DD commented
where i have to paste this code?
Sandeep-Bolla commented
where i have to paste this code?
You need to paste the code at the place where you installed your flutter sdk
Go to
flutter ->.pub-cache -> hosted-> pub.dartlang.org -> flute_music_player-0.0.6 -> lib -> flute_music_player.dart
then at the end of that file you can see " Class song " and replace the whole class with the given class.
Hope this is helpful.๐