Open braj065 opened 1 year ago
I'm using a StateNotifierProvider
to accomplish this: In the push notifications handler i update the state object according to the message's content which is then read and processed in the navigation widget:
ref.listen<NavigationState>(navigationStateProvider, (previous, next) {
_currentTabIndex = next.currentTabIndex;
_beamerDelegate.beamToNamed(ref.read(navigationStateProvider.notifier).currentPath);
});
Currently you could achieve this with some custom calls to specific BeamerDelegate
, as @rivella50 suggested. I've been thinking about this and will be adding this feature in Beamer v2
. It will also ease managing deep-links that need to pass some complex auth redirection first before landing on the deep-link.
@slovnicki Please add this to v2 milestone.
Please provide a beamer example which can be followed to handle routing to screens on clicking of push notifications.
It would be great if the beaming can be independent of BuildContext. Since push notifications are a stream which is handled in flutter's main file before runApp(). So buildcontext won't be available in that code section.