pause method
Resumes the currently played (but resumed) background music. Pauses the background music without unloading or resetting the audio player.
Implementation
// Future<void> resume() async {
// if (audioPlayer != null) {
// isPlaying = true;
// await audioPlayer!.resume();
// }
// }
/// Pauses the background music without unloading or resetting the audio
/// player.
Future<void> pause() async {
if (player != null) {
isPlaying = false;
player?.pause();
}
}