dispose method

  1. @override
void dispose()
override

Release the resources used by this object. The object is no longer usable after this method is called.

The most recently returned TickerFuture, if any, is marked as having been canceled, meaning the future never completes and its TickerFuture.orCancel derivative future completes with a TickerCanceled error.

Implementation

@override
void dispose() {
  for (var item in _listeners) {
    removeListener(item);
  }
  for (var item in _statusListeners) {
    removeStatusListener(item);
  }
  if (videoItem != null && videoItem!.autorelease) {
    videoItem!.dispose();
  }
  videoItem = null;
  super.dispose();
}