dispose method

  1. @override
void dispose()
override

Dispose the state

Implementation

@override
void dispose() {
  if (!isInitialized) {
    return;
  }
  if (cachedCreatorMocks.length > 1) {
    cachedCreatorMocks.removeLast();
  }
  sideEffectsGlobal?.dispose?.call();

  assert(() {
    if (debugPrintWhenNotifiedPreMessageGlobal != null) {
      _snapState = _snapState.copyWith(
        status: StateStatus.isIdle,
        infoMessage: kDisposeMessage,
      );
      _snapState.debugPrint();
    }
    return true;
  }());
  // resetDefaultState();
  super.dispose();
}