Skip to content

Commit

Permalink
fix: keep previous player status on previous or next (#1244)
Browse files Browse the repository at this point in the history
* keep track of previous player status

* code format
  • Loading branch information
ghassenbenzahra123 authored Aug 3, 2024
1 parent a226116 commit c442723
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ class QuranAudioPlayer extends AsyncNotifier<QuranAudioPlayerState> {
currentIndexSubscription = audioPlayer.currentIndexStream.listen((index) {
log('quran: QuranAudioPlayer: currentIndexStream called');
final index = audioPlayer.currentIndex ?? 0;
final currentPlayerState = audioPlayer.playing ? AudioPlayerState.playing : AudioPlayerState.paused;
state = AsyncData(
state.value!.copyWith(
surahName: localSuwar[index].name,
playerState: AudioPlayerState.playing,
playerState: currentPlayerState,
reciterName: moshaf.name,
),
);
Expand Down

0 comments on commit c442723

Please sign in to comment.