isSlotVisible function
True while the slot's route is current and no ancestor Visibility hides it (an IndexedStack hides inactive tabs). Reading both rebuilds on change.
Implementation
bool isSlotVisible(BuildContext context) =>
(ModalRoute.of(context)?.isCurrent ?? true) && Visibility.of(context);