stop method

  1. @override
Future<void> stop()
override

Stop playback and release resources.

The default implementation (which may be overridden) updates playbackState by setting the processing state to AudioProcessingState.idle which disables the system notification.

Implementation

@override
Future<void> stop() async {
  playbackState.add(playbackState.nvalue!
      .copyWith(processingState: AudioProcessingState.idle));
  await playbackState.firstWhere(
      (state) => state.processingState == AudioProcessingState.idle);
}