install method
Called when the route is inserted into the navigator.
Uses this to populate overlayEntries. There must be at least one entry in this list after install has been invoked. The Navigator will be in charge to add them to the Overlay or remove them from it by calling OverlayEntry.remove.
Implementation
@override
void install() {
final opener = FocusManager.instance.primaryFocus;
final fromFocusedControl =
opener != null &&
opener is! FocusScopeNode &&
FocusManager.instance.highlightMode == FocusHighlightMode.traditional;
_focus.capture();
super.install();
if (fromFocusedControl) {
WidgetsBinding.instance.addPostFrameCallback((_) {
// Let the navigator and an explicit autofocus in the panel settle.
scheduleMicrotask(() {
final page = subtreeContext;
if (_disposed || !isCurrent || page == null) return;
final scope = FocusScope.of(page);
if (scope.hasPrimaryFocus) scope.nextFocus();
});
});
}
_spring.attach(controller!);
controller!.addStatusListener(_rested);
_size = AnimationController.unbounded(
vsync: navigator!,
value: initialSize ?? 1,
);
final sheetController = this.sheetController;
if (sheetController != null) {
sheetController._attach(_host);
_size!.addListener(sheetController._changed);
}
}