didAdd method

  1. @override
void didAdd()
override

Called after install when the route is added to the navigator.

This method is called instead of didPush when the route immediately appears on screen without any push transition.

The didChangeNext and didChangePrevious methods are typically called immediately after this method is called.

Implementation

@override
void didAdd() {
  if (_scopeKey.currentState != null && navigator!.widget.requestFocus) {
    navigator!.focusNode.enclosingScope?.setFirstFocus(_scopeKey.currentState!.focusScopeNode);
  }
  super.didAdd();
}