setState method

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

Schedule a call to buildTransitions.

Whenever you need to change internal state for a ModalRoute object, make the change in a function that you pass to setState, as in:

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

If you just change the state directly without calling setState, then the route will not be scheduled for rebuilding, meaning that its rendering will not be updated.

Implementation

@override
void setState(VoidCallback fn) => $_invoke('setState', [
      $Function((runtime, target, args) {
        fn();
        return const $null();
      })
    ]);