SchabanBo / qlevar_router

Manage you project Routes. Create nested routes. Simply navigation without context to your pages. Change only one sub widget in your page when navigating to new route.
MIT License
87 stars 22 forks source link

Full path matching is attempted when the child route cannot be matched #154

Closed miaosun009 closed 1 month ago

miaosun009 commented 2 months ago
routerDelegate: QRouterDelegate(
        [
          QRoute(
            path: '/',
            builder: () => Main(),
          ),

          QRoute.withChild(
            path: '/auth',
            children: [
              QRoute(
                path: 'login',
                builder: () => Home("login"),
              )
            ],
            builderChild: (r) {
              return Shell(r);
            },
          ),
          QRoute(
            path: '/auth/home',
            builder: () => Home("home"),
          ),
        ],
        initPath: '/',
        observers: [],
      ),

Here's an example: When I normally access /auth/login using QR.to('/auth/login'), the result is as expected. However, when I access QR.to('/auth/home'), it fails to match the path because home cannot be found within the children of /auth. I expect the result to match /auth/home, which is consistent with the result under go_route.

SchabanBo commented 1 month ago

Thanks