smoothlyStopBackground method

Future<void> smoothlyStopBackground(
  1. Duration time
)

Lineary interpolates the volume of background to zero, then disposes it.

Implementation

Future<void> smoothlyStopBackground(Duration time) async {
  await lerpBackroundVolume(0, time);
  await _backgroundPlayer?.dispose();
  _backgroundPlayer = null;
  _currentlyPlayingAsset = null;
}