Skip to content

How to open notifications from background tasks? OverlaySupport Not Initialized #89

@josefrvaldes

Description

@josefrvaldes

Hi, I'm using this library and I can display notifications easily when calling this code from within a screen.
showOverlayNotification( (context) { return Card(...); }, duration: Duration(milliseconds: 8000), );

But if I call the same code from within a background process which is not tied to any screen, I receive this error: _AssertionError ('package:overlay_support/src/overlay.dart': Failed assertion: line 59 pos 10: '_debugInitialized': OverlaySupport Not Initialized ! ensure your app wrapped widget OverlaySupport).

I'm using 1.0.5-hotfix1 version since in this project I'm tied to flutter version 1.22.6. So I can't use OverlaySupport.global().

I'm using OverlaySupport(child: MaterialApp(...)). If I try to also add OverlaySupport to all the screens, I receive the error There is already an OverlaySupport in the Widget tree.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions