pause method

Future<PlaybackState?> pause({
  1. String? deviceId,
  2. bool retrievePlaybackState = true,
})

Pause playback on the user's account. deviceId is optional. If not provided, the user's currently active device is the target. retrievePlaybackState is optional. If true, the current playback state will be retrieved. Defaults to true.

Implementation

Future<PlaybackState?> pause(
    {String? deviceId, bool retrievePlaybackState = true}) async {
  await _api._put('$_path/pause?${_buildQuery({'device_id': deviceId})}');

  return retrievePlaybackState ? playbackState() : null;
}