pause method Null safety

Future<void> pause()

Pauses the currently playing media. This method does nothing if ![playing].


Future<void> pause() async {
  if (_disposed) return;
  if (!playing) return;
  _playInterrupted = false;
  // Update local state immediately so that queries aren't surprised.
  _playbackEvent = _playbackEvent.copyWith(
    updatePosition: position,
  // TODO: perhaps modify platform side to ensure new state is broadcast
  // before this method returns.
  await (await _platform).pause(PauseRequest());