setQueue method

Future<void> setQueue({
  1. required List<String> songIDs,
  2. required String startID,
  3. bool startPlaying = true,
})

Set the queue by giving the songIDs desired to be added to the queue. If startPlaying is false, the queue will not autoplay. If startID is provided, the queue will start from the song with the id startID.

Implementation

Future<void> setQueue({
  required List<String> songIDs,
  required String startID,
  bool startPlaying = true,
}) async {
  if (!songIDs.contains(startID)) {
    throw PlatformException(
        code: 'Incorrect Arguments!',
        message: 'songIDs must contain startID if provided.');
  }
  await playerChannel.invokeMethod('setQueue', <String, dynamic>{
    'songIDs': songIDs,
    'startPlaying': startPlaying,
    'startID': startID
  });
}