setPitch method Null safety

Future<void> setPitch(
  1. double pitch
)

Sets the factor by which pitch will be shifted.

Implementation

Future<void> setPitch(final double pitch) async {
  if (_disposed) return;
  _playbackEvent = _playbackEvent.copyWith(
    updatePosition: position,
    updateTime: DateTime.now(),
  );
  _playbackEventSubject.add(_playbackEvent);
  _pitchSubject.add(pitch);
  await (await _platform).setPitch(SetPitchRequest(pitch: pitch));
}