This repository was archived by the owner on Oct 13, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
This repository was archived by the owner on Oct 13, 2025. It is now read-only.
ShellRoute deeplink not working if it's path isn't '/' #8
Copy link
Copy link
Open
Description
Hello,
I think I've encountered a bug with ShellRoute. Considering the following router setup, I'm not able to navigate to /shell/child when entering url in navigator (chrome):
final GoRouter _router = GoRouter(
routes: [
StackedRoute(
path: '/',
builder: (context) => const DummyPage(),
),
ShellRoute(
path: '/shell',
builder: (context, child) => Scaffold(
body: child,
appBar: AppBar(title: const Text('Shell')),
),
routes: [
StackedRoute(
path: 'child',
builder: (context) => const DummyPage(),
),
],
),
StackedRoute(
path: '/other',
builder: (context) => const DummyPage(),
),
],
);I'm able to navigate to /, /shell, and /other, but when I'm entering /shell/child in the url I'm redirected to /.
The problem disappears if I set the ShellRoute path to / instead of /shell.
Here is a minimal reproducible example.
import 'package:flutter/material.dart';
import 'package:go_router_prototype/go_router_prototype.dart';
void main() {
WidgetsFlutterBinding.ensureInitialized();
runApp(App());
}
class App extends StatelessWidget {
App({
super.key,
});
final GoRouter _router = GoRouter(
routes: [
StackedRoute(
path: '/',
builder: (context) => const DummyPage(),
),
ShellRoute(
path: '/shell',
builder: (context, child) => Scaffold(
body: child,
appBar: AppBar(title: const Text('Shell')),
),
routes: [
StackedRoute(
path: 'child',
builder: (context) => const DummyPage(),
),
],
),
StackedRoute(
path: '/other',
builder: (context) => const DummyPage(),
),
],
);
@override
Widget build(BuildContext context) {
return MaterialApp.router(
routeInformationParser: _router.parser,
routerDelegate: _router.delegate,
);
}
}
class DummyPage extends StatelessWidget {
const DummyPage({
super.key,
});
@override
Widget build(BuildContext context) {
return Center(
child: Text(RouteState.of(context).route.path),
);
}
}I hope I'm not disrupting this project by opening this issue since it's only a prototype.
Thanks.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels