Closed golane-august closed 2 years ago
This is something you need to manage. That actions are triggered for a notification action doesn't mean the context is available for the plugin as a BuildContext
is related to a location of a widget so doesn't really have relation to the plugin's functionality
Ok it seems that the example provides a good workaround with BehaviorSubject
Is there a way to get the current
BuildContext
when callback for anotification action
vianotificationTap
is called. I mean the function is only called, when the app is brought to foreground, so there should be somewhere a context be available.Reason is that I want to execute an action, which is provided by a
riverpod
provider, which is only available from the current context. And also want to display an alert box then. But I don't see a way to hook in the current build process. I saw there is apayload
attribute, but this is not enough to access the build context.Thank you very much! Also searching for a solution, not requiring any static variables, if possible.