fix(app): remove every app-level system Back override

This commit is contained in:
2026-10-24 16:32:02 +01:00
parent 7bb95d4610
commit c6342ac6cc
12 changed files with 139 additions and 392 deletions
@@ -73,8 +73,6 @@ void main() {
router = AppRouterDelegate(
initial: AppRoute.chat,
cupertino: false,
onPopToChat: () => fail('Chat Back must not use the router override'),
onPopToRuns: () {},
builder: (_, route) => AdaptiveShell(
destination: AppDestination.chat,
destinationBodies: {
@@ -155,14 +153,11 @@ void main() {
expect(router.route, AppRoute.chat);
expect(find.text('Scroll and return'), findsOneWidget);
expect(find.byKey(const ValueKey('chat-thread-s')), findsNothing);
expect(find.text('Press back again to close'), findsNothing);
expect(exits, isEmpty);
await tester.binding.handlePopRoute();
await tester.pumpAndSettle();
expect(find.text('Press back again to close'), findsOneWidget);
expect(exits, isEmpty);
// At the main screen Back is the platform's: no exit prompt.
await tester.binding.handlePopRoute();
await tester.pump();
expect(find.text('Press back again to close'), findsNothing);
expect(exits, ['SystemNavigator.pop']);
await tester.pumpWidget(const SizedBox.shrink());
disposeRouter();