dispose method

  1. @mustCallSuper
void dispose()

Releases any resources used by the object.

This method is called by the owner of this gesture recognizer when the object is no longer needed (e.g. when a gesture recognizer is being unregistered from a GestureDetector, the GestureDetector widget calls this method).

Implementation

@mustCallSuper
void dispose() {
  // TODO(polina-c): stop duplicating code across disposables
  // https://github.com/flutter/flutter/issues/137435
  if (kFlutterMemoryAllocationsEnabled) {
    FlutterMemoryAllocations.instance.dispatchObjectDisposed(object: this);
  }
}