JaspervanRiet / duck_router

A Flutter router with intents
MIT License
4 stars 3 forks source link

feat: add support for fire-and-forget deeplink handling #32

Closed DelcoigneYves closed 3 weeks ago

DelcoigneYves commented 3 weeks ago

Description

While implementing deeplinks with this package, we found that when a deeplink is received, we need to immediately return a Location stack. However, we would instead like to either:

This should already be supported, as per the documentation in the readme:

consider keeping the deeplink location in memory and acting upon it later.

Since it is required to return a Location stack, our current workaround is to either return the userSpecifiedInitialLocation, or fetch and return the currentConfiguration.locationStack. It is only due to the Router implementation that this in fact does not trigger a navigation (since the Page stack remains the same). However this feels dirty and prone to error in the future.

Making the response of the deeplink callback optional, allows us in a more developer-friendly way handle our scenario.

Related Issues

/

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

DelcoigneYves commented 3 weeks ago

Thanks for the confirmation! I've updated the documentation, can you check?

JaspervanRiet commented 3 weeks ago

Some small formatting issues it looks like

DelcoigneYves commented 3 weeks ago

My bad, should be fixed now