I tried to look for solutions on internet but I didn't get one. I also tried some ways but still it didn't work. I have used just audio and flutter audio query plugins for audio player, and I tried to use audio service plugin for making it running in background and notification controls. I don't know how to implement the List<SongInfo
> to .<MediaItem>
Sample code for Audio Query
List<SongInfo> songs = [];
void getTracks() async {
songs = await audioQuery.getSongs();
setState(() {
songs = songs;
});
}
Sample for audio Service:
class AudioPlayer extends BackgroundAudioTask{
final FlutterAudioQuery audioQuery = FlutterAudioQuery();
//background audio player class
final _queue = <MediaItem>[];
}