0

I am using audio_service for background music with just_audio. Everything is working fine.

I want to add heart rating style. When user play a song in playlist, there will be option to press heart icon to add into favourite list. In MediaItem there is Rating property. I can set the rating before load into queue. Now I want to set the rating for current song in queue. There is no way to set the rating.

I try to update the queue item as follow, it is not update either.I check in queue and item in queue is updated but not in playlist is not updated.

@override
Future<void> updateMediaItem(MediaItem mediaItem) async {
    int index = queue.value.indexWhere((item) => item.id == mediaItem.id);
    if (index != -1) {
        queue.value[index] = mediaItem;
    }
}
Alex Aung
  • 2,637
  • 5
  • 34
  • 63

1 Answers1

0

Ok. I want to closed this question. It is happing because I need to change the one of the ValueNotifier.value.

Alex Aung
  • 2,637
  • 5
  • 34
  • 63