setState method

void setState([
  1. VoidCallback? fn
])

self defined setState

Implementation

void setState([VoidCallback? fn]) async {
  assert(() {
    __shower_log__('Rebuilding... setState was called.');
    return true;
  }());
  if (!isBuilt) {
    await builtCompleter.future;
  }
  fn?.call();
  StatefulElement? element = _statefulKey.currentContext as StatefulElement?;
  if (element == null) {
    assert(() {
      __shower_log__('[DialogShower] ❌ Do not call setState called during build or disposed!');
      return true;
    }());
    return;
  }
  element.markNeedsBuild();
  // _builderExKey.currentState?.setState(fn);
  // _statefulKey.currentState?.setState(fn);
}