In the MaterialApp
constructor, I am injecting a widget in the builder
method to handle push notifications. To process foreground notification, I would like to use this widget to show a notification bar (using another_flushbar
) but I need a Navigator in the context for that, and MaterialApp
's builder injects above the Navigator, so when I try to using it to push my notification bar, there is no Navigator accessible via the context.
Of course, I could wrap every screen of my app with my notification-handling widget, but it defeats the purpose. I want a widget that is always on screen when the app is running, and that can show my notification bar, wherever I am in my app.
Any idea how I can do that?