setState method

  1. @override
void setState(
  1. VoidCallback fn
)
override

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

Whenever you change the internal state of a State object, make the change in a function that you pass to setState:

setState(() { _myState = newValue; });

Implementation

@override
void setState(VoidCallback fn) {
  if (!mounted) return;
  super.setState(fn);
}