Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement navigation history #265

Closed
bdlukaa opened this issue Apr 2, 2022 · 2 comments
Closed

Implement navigation history #265

bdlukaa opened this issue Apr 2, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@bdlukaa
Copy link
Owner

bdlukaa commented Apr 2, 2022

Is your feature request related to a problem? Please describe.
A back button is added to the app bar, but it's always disabled, making it useless.

Describe the solution you'd like
Implement a navigation history. The back button should be enabled when the navigation can go backwards. It should support the following navigation flows:

It should be accessible to the devs, with something like NavigationHistory.of(context), in order to make it possible to create custom navigation flows.

Could be done by wrapping the API around a nested Navigator on the body

Describe alternatives you've considered
Using the built-in flutter navigator (Navigator.of(context)). Altough that's a bad approach, since most of the app will live under a NavigationView, and using the built-in navigator can't make the inner navigation possible.

Navigator 2.0 is a possibility, and would make it possible to create a nice web navigation flow with url.

Additional context

@bdlukaa bdlukaa added the enhancement New feature or request label Apr 2, 2022
@klondikedragon
Copy link
Contributor

Ideally this would integrate with Navigator 2.0 to "go back" and to know if there is anything to go back to. It's likely much simpler this way to implement anyway. Currently, I'm using vRouter (implements Nav 2.0 interfaces) combined with fluent_ui in my app (sketch of the approach here), and it has nice web navigation flow using browser forward/backward buttons in combination with NavigationView (including ability to navigate inside of NavigationView). In my app for web deployment I've just hidden the back button on the fluent_ui app bar and expect users to use the stock browser back/forward functions. Once I get to desktop version I'll possibly probably use something like bitsdojo_window to add custom forward/back buttons on a custom app title bar.

@bdlukaa
Copy link
Owner Author

bdlukaa commented Mar 31, 2023

I think this can be closed. The example app shows how to implement it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants