MaikuB / blog-comments

Tracks blog comments made at https://dexterx.dev
0 stars 0 forks source link

Creating a responsive Flutter application using Material Design using a navigation drawer #4

Open utterances-bot opened 4 years ago

utterances-bot commented 4 years ago

Creating a responsive Flutter application using Material Design using a navigation drawer

https://dexterx.dev/creating-a-responsive-flutter-application-with-a-navigation-drawer/

saneatsu commented 4 years ago

Thank you your post.

I'm currently developing an application for iPad with Flutter. It is only used on iPad, not on iPhone or Android.

I want to always display the sidebar where Items are arranged like BottomNavigationBar, but when using Navigator.of.push, moving screen with the sidebar disappeared.

I wanna make the transition with the sidebar still displayed as in Twitter for iPad, but if anyone knows how to do it, please let me know.

This is my question in stackoverflow.

https://stackoverflow.com/questions/62549820/how-to-fix-sidebar-when-using-navigation-of-push-on-ipad

MaikuB commented 4 years ago

The problem you're seeing is because you're using the top-level/root navigator that is associated with the MaterialApp. Any routes you push will result in a full-page transition as the navigator encompasses the entire app. What you need to look into is having a nested navigator. This navigator that would be wrap around where your details pane would be. You can find a number of articles on using nested navigators online (e.g. with the BottomNavigatorBar so that each tab maintains it's own navigation stack). I also have a package for applications that are looking to only support a master-detail layout https://pub.dev/packages/master_detail_scaffold