fix(shell): keep the tab destination ready behind pushed pages

This commit is contained in:
2026-10-24 11:14:10 +01:00
parent 399d520c71
commit 877c2f1acd
3 changed files with 43 additions and 41 deletions
+13 -19
View File
@@ -15,7 +15,6 @@ class AdaptiveShell extends StatefulWidget {
this.onDestinationSelected,
this.onSearch,
this.attentionCount = 0,
this.detailOpen = false,
});
final Map<AppDestination, WidgetBuilder> destinationBodies;
@@ -34,10 +33,6 @@ class AdaptiveShell extends StatefulWidget {
/// so it stays visible from any destination. Zero shows no badge.
final int attentionCount;
/// A pipeline, run or chat is open: on a phone it takes the whole screen,
/// like its own page, and the destination bar steps aside until Back.
final bool detailOpen;
@override
State<AdaptiveShell> createState() => _AdaptiveShellState();
}
@@ -188,19 +183,18 @@ class _AdaptiveShellState extends State<AdaptiveShell> {
: Column(
children: [
Expanded(child: _destinationStack(contents, index)),
if (!widget.detailOpen)
CupertinoTabBar(
currentIndex: index,
onTap: (value) =>
_select(AppDestination.values[value]),
items: _items((destination) {
final item = destinationDetails(destination);
return BottomNavigationBarItem(
icon: _icon(destination, item.cupertinoIcon),
label: item.label,
);
}),
),
CupertinoTabBar(
currentIndex: index,
onTap: (value) =>
_select(AppDestination.values[value]),
items: _items((destination) {
final item = destinationDetails(destination);
return BottomNavigationBarItem(
icon: _icon(destination, item.cupertinoIcon),
label: item.label,
);
}),
),
],
),
),
@@ -256,7 +250,7 @@ class _AdaptiveShellState extends State<AdaptiveShell> {
Expanded(child: _destinationStack(contents, index)),
],
),
bottomNavigationBar: wide || widget.detailOpen
bottomNavigationBar: wide
? null
: NavigationBar(
selectedIndex: index,