skipToIndex static method

Future skipToIndex({
  1. required String spotifyUri,
  2. required int trackIndex,
})

Skips to track at specified index in album or playlist

The spotifyUri can be an album or playlist The trackIndex is the index of the track in the playlist to be played Throws a PlatformException if skipping failed Throws a MissingPluginException if the method is not implemented on the native platforms.

Implementation

static Future skipToIndex({
  required String spotifyUri,
  required int trackIndex,
}) async {
  try {
    await _channel.invokeMethod(MethodNames.skipToIndex, {
      ParamNames.spotifyUri: spotifyUri,
      ParamNames.trackIndex: trackIndex,
    });
  } on Exception catch (e) {
    _logException(MethodNames.skipToIndex, e);
    rethrow;
  }
}