Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switchTo and routes with Path Parameters #160

Open
jessicamrbr opened this issue Nov 12, 2024 · 0 comments
Open

switchTo and routes with Path Parameters #160

jessicamrbr opened this issue Nov 12, 2024 · 0 comments

Comments

@jessicamrbr
Copy link
Contributor

Hi @SchabanBo

I'm having trouble using switchTo.

These case work fine:

  QRoute.withChild(
      path: '/workspaces',
      name: AppRoutes.workspace,
      builderChild: (route) => WorkspaceWidget(route),
      children: [
        QRoute(
          path: '/1',
          builder: () => const TextField(
            key: Key('t-1'),
          ),
        ),
        QRoute(
          path: '/2',
          builder: () => const TextField(
            key: Key('t-2'),
          ),
        ),

These cases present problems, in general either the widget simply isn't rebuilt, or I get navigation.observer == null.

  QRoute.withChild(
      path: '/workspaces',
      name: AppRoutes.workspace,
      builderChild: (route) => WorkspaceWidget(route),
      children: [
        QRoute(
          path: '/:id',
          builder: () => const TextField(
            key: Key('t-${QR.params['id']}'),
          ),
        ),

Alternatively I'm using dynamic routes, but it makes things very complex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant