setState method

void setState(
  1. void fn()
)
inherited

Notifies the framework that this state's internal data has changed.

The callback fn runs synchronously, then the owning element is marked dirty so it can rebuild in the next build scope.

Implementation

void setState(void Function() fn) {
  fn();
  _element?.markNeedsBuild();
}