dispose method

  1. @override
void dispose()
override

Dispose the state

You can not reuse the state after the dispose is called.

Implementation

@override
void dispose() {
  _streamController.close();

  if (_state == null) {
    return;
  }
  try {
    (_state as dynamic).dispose();
  } on NoSuchMethodError {
    // ignore it
  }
}