Closed raulmabe closed 3 years ago
go_router doesn't support this on purpose because it can't work in URLs, which means it can't support dynamic linking, deep linking, etc. However, in that case, you can use the old-style Navigator API, which is still available and supported; e.g. this call to Navigator.push
in the books sample.
I didn't know Navigator.push
was still available to use . I assume then that Navigator.pushNamed
isn't supported as MaterialApp.router
lacks the onGenerateRoute
parameter. (I am not very familiar with the MaterialApp.router
ctor)
If this is true, would be awesome to support the old-style Navigator with named pages. Maybe through an additional optional parameter inside GoRoute
(pageRouteBuilder
) which takes a Route
instead of a Page
, and links the named route to this pageRouteBuilder
. So we could call context.pushNamed('register', args: ComplexObject())
, but still support for query navigation.
You can also implement onGenerateRoute yourself, e.g.
MaterialApp.router(..., onGenerateRoute: myRouteGenerator)
Actually, the MaterialApp.router sets the onGenerateRoute
property to null
without option to implement it myself...
well darn it...
Hi 👋🏼 ! Firstly I'd like to thank you for this package 💙
Problem
I have a use case where I need to pass complex objects as arguments to some pages (instead of an ID). I haven't seen anything related on the docs so I asked myself if this is possible with the current package implementation.
As far as I understand the only way to pass arguments to routes with the package paradigm is via query parameters, which has a limit between 1024 and 2048 characters; which may cause me trouble in the future...