isHoisting method
Whether route should leave its chrome to the shell this frame.
True for every registered route while the shell is drawing, not only the topmost one: mid-transition the chrome is a blend of two routes' items, so the outgoing route has to keep its placeholder or its own buttons would slide out from underneath the pinned copy.
False under a presentation, even while presentingSheetItem is set: the chrome as a whole has been handed back, and only that item's capsule is still the shell's.
Implementation
bool isHoisting(
ModalRoute<dynamic> route, {
BuildContext? registrant,
}) {
if (!isActive || !_registry.containsKey(route)) return false;
final active = _activeEntryFor(route);
if (active == null) return false;
if (registrant != null &&
active.registrant != null &&
!identical(active.registrant, registrant)) {
return false;
}
final ordered = _orderedEntries;
if (ordered.isEmpty) return false;
return !_isPresentedOver(ordered.first.key);
}