boyan01 / boyan01/overlay_support

How to open notifications from background tasks? OverlaySupport Not Initialized

Open
#89 1 comment 3 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
379
Forks
103
PR merge metrics
No merged PRs in 30d

Description

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`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.