csells / go_router

The purpose of the go_router for Flutter is to use declarative routes to reduce complexity, regardless of the platform you're targeting (mobile, web, desktop), handling deep linking from Android, iOS and the web while still allowing an easy-to-use developer experience.
https://gorouter.dev
441 stars 97 forks source link

add route params for GoRouter #279

Closed iAmTosuj closed 2 years ago

iAmTosuj commented 2 years ago

Hello. There is an authentication code in my application. Because of this, I need to get the parameters of the deep link and open the desired page after entering the code. You have added parameters to redirect function for GoRoute, is it possible to add it for GoRouter?

Now the redirect function gets this state

        if (redirected(
          topRedirect(
            GoRouterState(
              this,
              location: loc,
              name: null,
              // trim the query params off the subloc to match route.redirect
              subloc: uri.path,
              // pass along the query params 'cuz that's all we have right now
              queryParams: uri.queryParameters,
            ),
          ),
        )) continue;

but i need this state

        if (redirected(
          top.route.redirect(
            GoRouterState(
              this,
              location: loc,
              subloc: top.subloc,
              name: top.route.name,
              path: top.route.path,
              fullpath: top.fullpath,
              params: params,
              queryParams: top.queryParams,
              extra: extra,
            ),
          ),
        )) continue;

it`s possible? thx.

csells commented 2 years ago

Interesting. Can I ask the usage? What would you routes look like in this case? What would your top-level redirect function look like?