Skip to content

Commit 73f852b

Browse files
committed
update README
1 parent 903fab9 commit 73f852b

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,25 @@ void overlayMain() {
109109
/// closes overlay if open
110110
await FlutterOverlayWindow.closeOverlay();
111111

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`.
113115
await FlutterOverlayWindow.shareData("Hello from the other side");
114116

115117
/// streams message shared between overlay and main app
116118
FlutterOverlayWindow.overlayListener.listen((event) {
117119
log("Current Event: $event");
118120
});
119121

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+
120131
/// use [OverlayFlag.focusPointer] when you want to use fields that show keyboards
121132
await FlutterOverlayWindow.showOverlay(flag: OverlayFlag.focusPointer);
122133

0 commit comments

Comments
 (0)