stop method

Future<void> stop()

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

Implementation

Future<void> stop() async {
  isPlaying = false;
  if (player != null) {
    player?.stop();
  }
}