FilledStacks / flutter-tutorials

The repo contains the source code for all the tutorials on the FilledStacks Youtube channel.
MIT License
4.75k stars 1.76k forks source link

Flutter Web Url Navigation #67

Open VarmaTech opened 4 years ago

VarmaTech commented 4 years ago

HI , i am facing issues as below As per your tutorial i kept url navigation which is working awesome, but i am not able to return to same page where i clicked refresh or reload in a particular page for example : i have navigated to Page 1 > Page 2 > Page 3 ( here i refresh or reloaded). now app is going back to initialRoute page i.e. Page 1.

Can i store the Navigated Page so that i can return to same page if refresh or reload .

when i click on Back in chrome , below error is showing up :

Error: Assertion failed: org-dartlang-sdk:///flutter_web_sdk/lib/_engine/engine/history.dart:110:14
            _userProvidedRouteName != null
            is not true
                at Object.throw_ [as throw] (http://localhost:60559/dart_sdk.js:4773:11)
                at Object.assertFailed (http://localhost:60559/dart_sdk.js:4724:15)
                at _engine.BrowserHistory.new.[_popStateListener] (http://localhost:60559/dart_sdk.js:143461:59)
FilledStacks commented 4 years ago

Hey, the named routing should be updating the url in the browser. A refresh should keep the same url and then navigate back to that page. Check if you can navigate to page 3 directly using a url only. Then refresh on it.

VarmaTech commented 4 years ago

HI @FilledStacks . I did that ,

i am developing a website in which : Page 1 : Login page Page 2 : Home page Page 3 : Details Page

so when i refresh Page 3 using chrome refresh button , i was redirected to Page 1 ,

but login authenication is getting skipped.

Note : RouteSettings is losing the name . i am getting empty name on chrome refresh button

FilledStacks commented 4 years ago

Mmmm, then I don't know. I know I fixed it in the Flutter web series, but it might have changed. If you're looking at using Flutter Web there's a lot of things that won't work as it should that you'll have to struggle with and figure out. I'll be sorting all these things out for my Flutter Web app some point in the next two months then I'll most likely make some update videos for it.

VarmaTech commented 4 years ago

@FilledStacks thanks man, i tried some ways but it is not working .

i appreciate your hard work . i am counting on you .

ll be waiting for your update .