repeat method
Future<PlaybackState?>
repeat(
- RepeatState state, {
- String? deviceId,
- bool retrievePlaybackState = true,
Set the repeat mode for the user’s playback.
state
is required. Options are: RepeatState.off,
RepeatState.track, RepeatState.context.
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?> repeat(RepeatState state,
{String? deviceId, bool retrievePlaybackState = true}) async {
await _api._put('$_path/repeat?${_buildQuery({
'state': state.toString().split('.').last,
'device_id': deviceId
})}');
return retrievePlaybackState ? playbackState() : null;
}