disposeIfNotUsed method

  1. @override
void disposeIfNotUsed()
override

Dispose the state if it has no listener

Implementation

@override
void disposeIfNotUsed() {
  if (autoDisposeWhenNotUsed && !hasObservers) {
    dispose();
  }
}