Closed gabriel-gheorghe closed 1 year ago
Hi @doublegarts,
Try this workaround, it works for me:
Add initPath
on MaterialApp.router to '/about'
and update QRoute.withChild
path to '/about' and change first route to /
Something like this:
final routes = [
QRoute.withChild(
path: '/about',
name: home,
builderChild: (router) => HomeScreen(router: router),
children: [
QRoute(
path: '/',
name: about,
builder: () => const AboutScreen(),
),
QRoute(
path: '/contact',
name: contact,
builder: () => const ContactScreen(),
),
],
),
];
MaterialApp.router(
routeInformationParser: const QRouteInformationParser(),
routerDelegate: QRouterDelegate(
AppRoutes().routes,
initPath: '/about',
),
);
Consider the next scenario:
It loads the AboutScreen inside the HomeScreen, but the path is missing from url. Also, when you try to switch to the ContactsScreen it navigates to the error page, the path still missing from the url.
If I change the path from '/' to '/home' or something else, it works properly, but I do not want to have 'home' inside the path.