shuffle method Null safety

Future<void> shuffle()

Recursively shuffles the children of the currently loaded AudioSource. Each ConcatenatingAudioSource will be shuffled according to its configured ShuffleOrder.

Implementation

Future<void> shuffle() async {
  if (_disposed) return;
  if (_audioSource == null) return;
  _audioSource!._shuffle(initialIndex: currentIndex);
  _updateShuffleIndices();
  await (await _platform).setShuffleOrder(
      SetShuffleOrderRequest(audioSourceMessage: _audioSource!._toMessage()));
}