install method
- @override
override
Called when the route is inserted into the navigator.
Use this to populate overlayEntries and add them to the overlay
(accessible as Navigator.overlay
). (The reason the Route is
responsible for doing this, rather than the Navigator, is that the
Route will be responsible for removing the entries and this way it's
symmetric.)
The insertionPoint
argument will be null if this is the first route
inserted. Otherwise, it indicates the overlay entry to place immediately
below the first overlay for this route.
Implementation
@override
void install(OverlayEntry insertionPoint) {
assert(_overlayEntries.isEmpty);
_overlayEntries.addAll(createOverlayEntries());
navigator.overlay?.insertAll(_overlayEntries, above: insertionPoint);
super.install(insertionPoint);
}