dispose method

void dispose([
  1. bool evict = false
])

Implementation

void dispose([bool evict = false]) {
  if (evict) {
    try {
      imageProvider.evict().catchError((Object e) {
        debugPrint(e.toString());
      });
    } catch (e) {
      // this may be never called because catchError will handle errors, however
      // we want to avoid random crashes like in #444 / #536
      debugPrint(e.toString());
    }
  }

  animationController?.removeStatusListener(_onAnimateEnd);
  animationController?.dispose();
  _imageStream?.removeListener(_listener);
}