-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to send data from the app to the overlay widget. #15
Comments
You can use the method await FlutterOverlayWindow.shareData("Hello from the other side"); and inside the overlay use FlutterOverlayWindow.overlayListener.listen((event) {
log("Current Event: $event");
}); |
Hi @X-SLAYER I tried as you mentioned, but data is printing in the logs. But it was not updating in the UI. Please check the below code once and correct me
I tried with setState and without setState as well. |
Amigos pueden usar al comunicación mediante puertos Isolate. Overlay********
En initiState del overlay registro el puerto con el nombre;
En el evento onTop() de algun widget del overlay, trato de obtener el puerto del home o main, como ustedes lo usen.
##para enviar mensaje del overlay al home usen, luego de haber registrado su homePort con la linea anterior.
MAIN o Home o como lo usen**** Propiedades del main, o home, o como lo usen.
metodo initState
##para enviar mensaje del home al overlay usen lo siguiente:
|
Hi @dorlanpabon, i tried to implement but it didn't work, I did what you say and also tried put kPortHomeName in registerPortWithName in home code. In home:
And in some onTap of widget overlay:
I noticed that mapPort receives Sendport, but it still doesn't work. |
Hola @birnayt , Trata de colocar el codigo del widget en una funcion que se ejecute luego del initState En mi caso, lo ejecuto en el onTap,
Esto debido a que puede que el puerto Home aún no esté registrado, por ello opte colocarlo en el onTap del widget. Avisame cualquier novedad |
First of all thank you very much @dorlanpabon! I needed to close debug and start again for it to work. It seems that the reload is not enough. Now works! |
Hi there,
I want to send some data from the app to the overlay button. For ex: Overlay chat head is having a text which can present the timer value. So, after enabling the overlay. I want to run the timer in the app, and the same data should reflect on the chat head as well. Please do help me on the same asap.
The text was updated successfully, but these errors were encountered: