stop method

Future<void> stop()

Stops the currently playing background music track (if any).

Implementation

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