shuffle method

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

Toggle Shuffle For User's Playback.

Use state to toggle the shuffle. true to turn shuffle on and false to turn it off respectively. retrievePlaybackState is optional. If true, the current playback state will be retrieved after setting the volume. Defaults to true.

Implementation

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

  return retrievePlaybackState ? playbackState() : null;
}