ajinasokan / flutter_fgbg

Flutter plugin to detect when app(not Flutter container) goes to background or foreground
MIT License
81 stars 34 forks source link

Allow multiple listeners on events stream #7

Closed roeierez closed 2 years ago

roeierez commented 2 years ago

Calling receiveBroadcastStream on flutter event channel unsubscribes the last listener before it subscribes a new listener. This causes every invocation of FGBGEvents.stream to unsubscribe previous listeners. Also as a side effect one can not both subscribe to a stream and use the FGBGNotifier. After this fix the stream will be created once (one listener) and can be safely subscribed multiple times.

ajinasokan commented 2 years ago

Thanks!