dispose method

void dispose()

Disposes of resources used by this chart. The chart will become unusable until draw is called again.

Be sure to call this method when the chart is no longer used to avoid any memory leaks.

@mustCallSuper

Implementation

void dispose() {
  // This causes [canHandleInteraction] to be `false`.
  _seriesList = null;
  _mouseMoveSub?.cancel();
  _mouseMoveSub = null;
  _dataTableSubscriptionTracker.clear();
  _legendItemSubscriptionTracker.clear();
}