playbackState method
Returns the current playback state, including progress, track
and active device. Returns an empty PlaybackState
object when
no playback context has been started.
Implementation
Future<PlaybackState> playbackState([Market? market]) async {
var jsonString =
await _api._get('$_path?${_buildQuery({'market': market?.name})}');
if (jsonString.isEmpty) {
return PlaybackState();
}
final map = json.decode(jsonString);
return PlaybackState.fromJson(map);
}