setState method

void setState(
  1. VoidCallback fn
)

Notifies the framework that the internal state of this object has changed.

Implementation

void setState(VoidCallback fn) {
  fn();
  (_context as StatefulElement).rebuild();
  if (onNeedRepaint != null) {
    onNeedRepaint!();
  }
}