didPush method

  1. @override
  2. @mustCallSuper
void didPush()
inherited

Called when this route has been pushed.

Implementation

@override
@mustCallSuper
void didPush() {
  // Don't if the State object is defunct.
  if (!mounted) {
    return;
  }

  // No 'setState()' functions are allowed
  _setStateAllowed = false;

  for (final con in controllerList) {
    con.didPush();
  }

  _setStateAllowed = true;

  if (_setStateRequested) {
    _setStateRequested = false;
    // Only the latest State is rebuilt
    if (isLastState) {
      // Perform a 'rebuild' if requested.
      setState(() {});
    }
  }

  // Record the triggered event
  assert(() {
    if (_printEvents) {
      debugPrint('============ Event: didPush() in $this');
    }
    return true;
  }());
}