Router: some missing features - feedback
Hello there!
I'm looking into jaspr for a couple of hobby projects. I ran into an issue with Router. It is mentioned on wiki that it is WIP so I thought I might still be in time to provide some feedback.
- First thing I noticed is that you there is no option to specify custom location strategies. Currently only path is considered. Which means I cannot easily "point to" tabs on a specific page. Something like
/my-awesome-page?tabbed-view=5-star. -
_ResolvedRouteis library private and therefore I cannot easily implement custom Route implementations either, nor can I extendResolvedRoutesince it is effectively sealed with default forwarding factory constructor.
Ultimately, I think my pain point is that I cannot customize routing which is quite restrictive. Even onGenerateRoute receives only the path. I think passing an URI to it would open up quite a few possibilities with minor code change. I could implement my custom routing logic.
Cheers!
Hi, thanks for the feedback.
I will defenitely consider it in the new router implementation. This will probably be a complete rewrite anyways and not work in the same way, so the ResolvedRoute won't be an issue then.
Also when I start working on it, I plan to open a design/discussion issue so others can comment on it.
Unfortunately however, I won't be able to work on jaspr over the next 4 weeks.
In the meantime, you can use the ComponentsBinding.instance!.currentUri getter to get the current route both on the server and client if you want to implement some custom routing logic. I hope this helps for now.
@daniel-v Hi have you tried https://pub.dev/packages/jaspr_router