Make Settings a top-level navigation destination
Show Back only when Settings is reached through a pushed route, and remove duplicate Settings controls where the shell already provides navigation. Update focused widget coverage and document the destination behavior.
This commit is contained in:
@@ -90,8 +90,8 @@ void main() {
|
||||
expect(find.text('runs body'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('Settings opens from the rail foot as a page and no tab is '
|
||||
'selected meanwhile', (tester) async {
|
||||
testWidgets('Settings opens from the rail foot as a destination with no '
|
||||
'Back and no tab is selected meanwhile', (tester) async {
|
||||
final semantics = tester.ensureSemantics();
|
||||
await pumpShell(tester, width: 1000);
|
||||
|
||||
@@ -106,8 +106,10 @@ void main() {
|
||||
.isSelected,
|
||||
Tristate.isTrue,
|
||||
);
|
||||
// The page's own Back returns to Pipelines, the tab it belongs to.
|
||||
await tester.tap(find.byKey(const ValueKey('shell.back')));
|
||||
// Opened from its rail item, Settings is not a page: no Back.
|
||||
expect(find.byKey(const ValueKey('shell.back')), findsNothing);
|
||||
// The Pipelines item leaves it for the Pipelines tab.
|
||||
await tester.tap(find.byKey(const ValueKey('shell.destination.pipelines')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(tester.widget<NavigationRail>(rail()).selectedIndex, 0);
|
||||
semantics.dispose();
|
||||
|
||||
Reference in New Issue
Block a user