dispose method

  1. @mustCallSuper
Future<void> dispose()

Implementation

@mustCallSuper
Future<void> dispose() async {
  await Future.wait(
    [
      playlistController.close(),
      playingController.close(),
      completedController.close(),
      positionController.close(),
      durationController.close(),
      bufferController.close(),
      volumeController.close(),
      rateController.close(),
      pitchController.close(),
      bufferingController.close(),
      audioParamsController.close(),
      videoParamsController.close(),
      audioBitrateController.close(),
      audioDeviceController.close(),
      audioDevicesController.close(),
      trackController.close(),
      tracksController.close(),
      widthController.close(),
      heightController.close(),
      subtitleController.close(),
      logController.close(),
      errorController.close(),
    ],
  );
  for (final callback in release) {
    try {
      callback.call();
    } catch (exception, stacktrace) {
      print(exception.toString());
      print(stacktrace.toString());
    }
  }
}