dispose method

  1. @mustCallSuper
void dispose()

Free up the resources associated with this ink feature.

Implementation

@mustCallSuper
void dispose() {
  assert(!_debugDisposed);
  assert(() {
    _debugDisposed = true;
    return true;
  }());
  // TODO(polina-c): stop duplicating code across disposables
  // https://github.com/flutter/flutter/issues/137435
  if (kFlutterMemoryAllocationsEnabled) {
    FlutterMemoryAllocations.instance.dispatchObjectDisposed(object: this);
  }
  _controller._removeFeature(this);
  onRemoved?.call();
}