You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am building web/mobile app and I want to achieve different navigation bar for different platforms. For example, in the web the navigation bar is usually persistent across pages but in mobile there are some scenarios that navigation bar should not be seen.
I have three pages. BookListView, BookDetailView, SettingsView. BookListView and SettingsView are in the navigation bar and from the BookListView users can navigate to selected BookDetailView. In mobile I want to open the BookDetailView in a seperate page (navigation bar hidden), but in the web I want to open BookDetailView in the same page with navigation bar. Currently I can't achieve this goal because in router file if I define the routes as a children of main layout (scaffold with navigation bar), the BookDetailView is can not be opened as a seperate page on the mobile. One solution that comes into my mind is defining different routes for platforms and doing some platform checks to use correct route but that can be messy I think. Is there any other way to implement this?
Image examples:
Layout on Web:
Layout on mobile:
I want to hide navigation bar on this page
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I am building web/mobile app and I want to achieve different navigation bar for different platforms. For example, in the web the navigation bar is usually persistent across pages but in mobile there are some scenarios that navigation bar should not be seen.
I have three pages. BookListView, BookDetailView, SettingsView. BookListView and SettingsView are in the navigation bar and from the BookListView users can navigate to selected BookDetailView. In mobile I want to open the BookDetailView in a seperate page (navigation bar hidden), but in the web I want to open BookDetailView in the same page with navigation bar. Currently I can't achieve this goal because in router file if I define the routes as a children of main layout (scaffold with navigation bar), the BookDetailView is can not be opened as a seperate page on the mobile. One solution that comes into my mind is defining different routes for platforms and doing some platform checks to use correct route but that can be messy I think. Is there any other way to implement this?
Image examples:
Layout on Web:
Layout on mobile:
I want to hide navigation bar on this page
app_router.dart
Code sample
layout_view.dart
Code sample
Beta Was this translation helpful? Give feedback.
All reactions