currentlyPlaying method

Future<PlaybackState> currentlyPlaying()

Get the object currently being played on the user’s Spotify account.

Implementation

Future<PlaybackState> currentlyPlaying() async {
  final jsonString = await _api._get('$_path/currently-playing');

  if (jsonString.isEmpty) {
    return PlaybackState();
  }

  return PlaybackState.fromJson(json.decode(jsonString));
}