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 96 forks source link

Broken navigation behaviour on shared scaffold example. #383

Closed Kiwi-KiwiCorp closed 2 years ago

Kiwi-KiwiCorp commented 2 years ago

On your shared scaffold example, if you swap out this line in the '_SharedScaffoldState' :

        navigationTypeResolver: (context) =>
            _drawerSize ? NavigationType.drawer : NavigationType.bottom,

with this line:

        navigationTypeResolver: (context) => _drawerSize
            ? NavigationType.permanentDrawer
            : NavigationType.bottom,

(NavigationType.rail also causes this) This seems to break the navigation functionality. I understand that this is an external package however I'm not sure that is what is causing the problem, and considering you use this package in your example, I would expect it to be fully functional.

The issue is that clicking on any of the menu items on the permanentDrawer cause the entire navigator to scroll to the right and display a blank white screen (despite the URL being correct). Strangely, clicking the navigation buttons within the pages themselves still works as expected if you ignore the navigator overlapping the sidebar on transition which is a flutter issue. This leads me to believe this is something to do with context as the only difference I can think of between the two is that you are outside the navigator when using the permanentDrawer.

Kiwi-KiwiCorp commented 2 years ago

I was originally planning on using nested navigation to achieve the permanent sidebar however when I discovered this example I realised this method is far more simple however I am now starting to think I should just go back to using a nested navigator.