I am currently using Navigation 1.0 and want to add deep links within the current navigation setup. I am aware that it is simple to add deep links with Navigation 2.0 using packages like go_router. However, I want to implement deep links without relying on any additional packages such as go_router, uni_links, or Firebase.
I have read a couple of articles where they explain the process using the mentioned packages, I prefer not to use them. i’m expecting to handle deep-links the current navigation 1.0 setup.
2
Answers
It is possible to handle deep-links without using any package. You need to write some native code to handle it though, That’s exactly why we use packages like uni_links or app_links.
Although, this link is mentioned in official flutter docs for deep-linking using native code (by writing a native plugin): Deep Links and Flutter applications. How to handle them properly
Actually it’s possible without writing a native code. Here is an example:
First configure the project for deep linking. Add schemas in the manifest file
Then add onGenerateRoute parameter to the MaterialApp widget
Now, by opening this link the app is opened with the route
/deep
(DeepPage):myapp://test.com/deep
Note: This example contains configuration for basic testing of a deep link. For the correct configuration for your project, and using universal app links on both android and iOS, follow instructions on this page (except the GoRouter part).
And here is the example project