pause method

Future<void> pause()

Pauses the background music without unloading or resetting the audio player.

Implementation

Future<void> pause() async {
  isPlaying = false;
  await audioPlayer.pause();
}