setState method
void
setState(
- void fn()
Notifies the framework that the internal state has changed, triggering a rebuild.
Implementation
void setState(void Function() fn) {
assert(mounted, 'setState() called after dispose()');
try {
fn();
_element?.markNeedsBuild();
} on Exception catch (e) {
assert(() {
throw StateError('setState() callback failed: $e');
}());
}
}