Open JamesMcIntosh opened 3 years ago
Can you provide a super simple implementation of this abstract class for two or more "pages", so I can grasp how you see the WidgetsBindingObserver
can help? Thanks.
Is the LinkListener
this plugin?
@avioli I've mocked up a stripped down version based my "real-world" implementation. There are a couple of comments in there but feel free to ask any clarification.
Using LinkObserver
works really well for routing based on Uri but if you need to also do something similar to your current example app then it could probably be done by refactoring LinkListener
to be a mixin
and mixing it into LinkObserver
and MyApp
.
The way that is suggested to handle listening for links is a little bit painful when you have many "page" level widgets in your app and expect that a link could appear when any of them are visible.
Using a WidgetsBindingObserver it is possible to extract the handling of Uris from the lifecycle of the widgets.
@avioli What do you think of this approach?
Many thanks James