Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

setState

@protected
void setState(VoidCallback fn) {
  if (_scopeKey.currentState != null) {
    _scopeKey.currentState!._routeSetState(fn);
  } else {
    // The route isn't currently visible, so we don't have to call its setState
    // method, but we do still need to call the fn callback, otherwise the state
    // in the route won't be updated!
    fn();
  }
}
Source by api.flutter.dev #
 
PREVIOUS NEXT
Tagged: #setState
ADD COMMENT
Topic
Name
7+4 =