File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -109,14 +109,25 @@ void overlayMain() {
109
109
/// closes overlay if open
110
110
await FlutterOverlayWindow.closeOverlay();
111
111
112
- /// broadcast data to and from overlay app
112
+ /// Broadcast data to and from overlay app.
113
+ /// This method may return `false` when invoked from the overlay while the application is closed.
114
+ /// Returns `true` if the data was sent successfully, otherwise `false`.
113
115
await FlutterOverlayWindow.shareData("Hello from the other side");
114
116
115
117
/// streams message shared between overlay and main app
116
118
FlutterOverlayWindow.overlayListener.listen((event) {
117
119
log("Current Event : $event");
118
120
});
119
121
122
+ /// Overlay status stream.
123
+ /// Emit `true` when overlay is showing, and `false` when overlay is closed.
124
+ /// Emit value only once for every state change.
125
+ /// Doesn't emit a change when the overlay is already showing and [showOverlay] is called,
126
+ /// as in this case the overlay will almost immediately reopen.
127
+ FlutterOverlayWindow.overlayStatusListener.listen((event) {
128
+ print("Overlay status : $event");
129
+ });
130
+
120
131
/// use [OverlayFlag.focusPointer] when you want to use fields that show keyboards
121
132
await FlutterOverlayWindow.showOverlay(flag : OverlayFlag.focusPointer);
122
133
You can’t perform that action at this time.
0 commit comments