-
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
[go_router] Route triggered twice after navigating from 3rd party app by link (deep linking) #137037
Comments
Thanks for the report @supervital |
No, it doesn’t give me the expected result.
And logs for three scenarios here. The first one - the code is run from AndroidStudio, and the BackButton pressed:
The second scenario: the app is closed with the back button, and I am clicking a link (https://example.com/details):
As you can see 'Open details screen' is printed twice. The third scenario: I closed the app by pressing the back button, and then I clicked a link. After that, I minimized the app using the home button, and I clicked the link again (I performed this step twice):
As you can see from the logs, the route Additionally, any route (e.g., |
Thanks for the update. Seeing the same behavior as reported. stable, master flutter doctor -v
|
I'm also curious about the route triggered when the app is closed using the back button. Please see the logs: [GoRouter] setting initial location /test Could you comment on this behavior? Thanks. |
I have been facing the same issue on my app from Go Router versions 6 to 12, has there been a fix for this yet? |
I am having the same problem in my application, is there a solution? |
@haticeay Play around |
@supervital the code worked thank you |
This workaround seems to solve the problem.
|
Hello.
I am currently working on implementing deep linking functionality in my application, which allows users to open the app via links received in emails. However, I have encountered an issue where the go_router behaves unexpectedly. Specifically, the route specified in go_router is triggered twice when the app is launched from a cold start. After the app has started, deep linking works as expected.
Steps to reproduce:
Expected Behavior:
The specified widget should be created only once when the deep link is triggered, ensuring a single instance of the widget.
Actual Behavior:
The widget is created twice when the application is launched from a cold start on Android.
Reproducibility:
The issue consistently occurs when the application is launched from a cold start on Android. It does not occur when the application is already running.
I use go_router 12.0.0.
Example from https://github.com/flutter/codelabs/tree/main/deeplink_cookbook with minor changes:
Android manifest file:
Dart code:
Expected results
The route should be triggered once.
Actual results
The route is triggered twice after the initial click on the link.
Logs
Logs
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: