dispose method Null safety

void dispose()

Marks the BuildContext as disposed.

Creators of this object must call dispose when their Element is unmounted, i.e. when State.dispose is called.

Implementation

void dispose() {
  _state = null;
}