-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[Question] Parallel routes auto redirect #35
Comments
Its implementation is totally correct! Are you experiencing any problems with this or just want to confirm that you are doing everything right? Everything seems to be ok for me, and even following good practices. Personally use SchedulerBinding.instance instead of WidgetsBinding.instance, because it allows you to listen to the end of the build method outside a Stateful and create a "SplashScreen" screen (similar to your authentication screen) to be more user friendly and display a loading, and put all authentication logic in my class's controller. if (! Get.key.currentState.canPop () && GetPlatform.isAndroid) { In android this behavior is expected, but in iOS it goes against human guidelines, and you can face problems. If your application is only android, there is no need to follow this tip. |
Thanks for your feedback, I'll take a look in this SchedulerBinding documentatio - I was trying to find something like that, but WidgetBinding was looking too much as ViewLayer stuff to put in the Controller/ViewModel And yes, i just wanted to confirm if this approach is correct using your library. I have to add this SystemNavigator.pop() because after user press back from /home it's redirect to this empty screen, that shouldn't be visible in this time being considering /home /login as the first item of the navigation stack, I just wanted to close the app when reach this point. Tried to handle with RouteObserver instead of listening a Future, but for some reason it wasn't been called when I get back to / path, was trying to read the source code, but haven't found the reason yet. Edit: Acabei de ver que voce tem um repositorio em portugues. |
Hi, I'm quite new to flutter world and I've been trying something to implement automatic route redirect based on current authentication state. I haven't found material about that and most of them is to have manual implementation that in a authenticated route keep listening if was unauthenticated, and then navigate back.
Then I got more or less the result that I was looking applying something that I used in RN and Native projects, but I wonder if there is any suggested way to do so.
When user login on LoginPage, it would navigate automatically to HomePage
When user logout on SettingsPage, it would navigate automatically to LoginPage
The text was updated successfully, but these errors were encountered: