I'm developing a web/desktop application that has a fairly standard UI layout involving a NavigationRail
on the left and a content pane taking up the remainder of the screen.
I've reciently added go_router
so I can properly support URLs in web browsers, however in doing so I have lost the ability to have any form of transition/animation when moving between pages as calling context.go()
causes a hard cut to the next page.
Theres also the issue that go_router
routes have to return the full page to be rendered meaning I need to include the navigation rail on every page rather than each page being just the content relevant to that page. I believe this is also the main reason all animations are broken, because clicking a link effectively destroys the current navigation rail and builds a new one for the new page
I couldn't see anything in go_router
but is there any form of builder API available that can output and refresh a single section of the page? I'm thinking of something like bloc
's BlocBuilder
which listens for state changes and rebuilds just the widget its responsible for when a change occures.
Alternatively, is there a way to update the current URL without rebuilding the whole page?
Or is go_router
just not capable of what I'm after, and if so, are there any alternatives that can do this?
The overall effecti I'm after is similar to the material site https://m3.material.io/develop Clicking around the various buttons feels like you are navigating around within an app rather than clicking on links and loading new pages
Thanks for your help
Navigator
viaMaterialApp.router(builder:
. However, this causes anNo GoRouter found in context
error, as discussed here, for which I do not yet have a workaround. – IndispositionNo GoRouter found in context
by usingrouterConfig.routerDelegate.navigatorKey.currentContext
as your.go(context)
context
. I was able to get things working this way. Hopefully I'll be able to summarize an answer in a few days. If I don't, an implementation should soon be available in my Dansdata Portal repository – Indisposition