-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
Web like routing in flutter without stack #131537
Comments
go_router covers these points
not sure of what you mean, but sounds like state restoration to me;
it really depends from the type of navigation:
this is the current implementation afaik |
@iapicca go_router is no better than the flutter implementation of routing itself. Either it replaces or creates a stack both of which flutter already provides. What I really want is more browser like navigation. If you're aware of browser navigation it doesn't create stacks instead completely removes the current page and renders a new one while maintaing the history. Btw I did try go_router FYI and it does no good for me it does nothing special that flutter doesn't already do. |
Flutter is not web based, for some may be a minus, for other like me is a plus; Could be useful if you could point out |
@Aamir2000 As pointed above already, you should take a look at navigator 2.0 to understand how Flutter handles the navigation and also state restoration which gives app developers the possibility to store state and recover it after a page refresh (or after the app is killed in the background on mobile ). There's also an open issue you can track for navigator 2.0 and state restoration for web if that interests you: #65777 Another issue you may want to check is #108114 and see if it relates to your use case or not.
This is a very generic proposal which may not be feasible / practical to achieve and not complete to make this issue actionable. If you are facing any specific challenges when it comes to navigation or using go_router package, I suggest you to file separate issues with proper code sample along with current limitation and expected behavior you are looking for, so that we can properly evaluate and address those issues as applicable. With above given details, I am going ahead and closing this issue. If you disagree, write in comments or open new issue with specific cases and we'll address them. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Is there an existing issue for this?
Use case
Web like routing ( without stack )
Hi Flutter Devs, I wanna request a feature and this is like actually really serious and something that should've existed in flutter for a long long time but for some reason it doesn't. I want in my applications to be able to navigate between different routes without having that strange stack routing thing. I need to be like web browsers.
What's the point you ask?
Well in most if not all applications in my usecases require camera, tons of forms and other things...with flutter stack based routing thing I have to manually conditionally dispose off all the data and close the camera otherwise it keeps the camera active.
For example a qr scanner keeps running and keeps scanning the same QR code millions of times even when I'm not even seeting the camera in the background. If I have logic to move to different screen on QR then it opens up duplicates of same screen multiple times thanks to its poorly thoughtout routing system.
It's really a rant at this point. Just because of it's routing and bad syntax of callback hell I was keeping away from this framework but I'd consider you can atleast fix 1 major problem like routing in this thing.
Dart is such a cool language but not sure what benefit that callback hell syntax gives flutter over just simple language like dart. Browser vendors like dying to prevent callback hells with promises in javascript and here we are using it like no tomorrow. although I'd leave the thought of ever seeing flutter fixing and rewriting the whole framework again.
Proposal
Make flutter routing more like React native or Ionic
The text was updated successfully, but these errors were encountered: