Comments (11)
Greetings,
I am trying to send data from overlay to main app. My use case is that whe I tap the overlay, I call:
await FlutterOverlayWindow("capture");
Then I the initState of the home widget of the main App, I am listening to the overlay listener
FlutterOverlayWindow.overlayListener.listen((event) { print("Overlay $event"); });
Unfortunately, the listener (in the main app) is not triggering when I call shareData (from the overlay).
Please help! 😭 TIA
FlutterOverlayWindow.shareData('7hajhsb'); useless too
from flutter_overlay_window.
Greetings,
I am trying to send data from overlay to main app. My use case is that whe I tap the overlay, I call:await FlutterOverlayWindow("capture");
Then I the initState of the home widget of the main App, I am listening to the overlay listenerFlutterOverlayWindow.overlayListener.listen((event) { print("Overlay $event"); });
Unfortunately, the listener (in the main app) is not triggering when I call shareData (from the overlay).
Please help! 😭 TIAFlutterOverlayWindow.shareData('7hajhsb'); useless too
I meant to type FlutterOverlayWindow.shareData('capture');
Sorry for the typo.
from flutter_overlay_window.
I was able to communicate between overlay and the app using sockets. My Main App creates a socket server and the overlay connects to that socket server.
My use case was that I wanted to invoke a native method by pressing the overlay. So what happens now is that, when I tap the overlay, it send a string over the socket connection and when my main app receives the message, it decides which native method to invoke.
I know this is not a fix, but rather a workaround in case the fix is not coming around any time soon. Hope it helps.
from flutter_overlay_window.
hello sorry for that i will try to check and fix that asap you can use the workaround of the socket until the bug get fixed
from flutter_overlay_window.
hello sorry for that i will try to check and fix that asap you can use the workaround of the socket until the bug get fixed
No problem mate take your time 👌🏻
Good luck🤞🏻
from flutter_overlay_window.
Hello, has this problem been solved? Or if not can someone explain how to communicate between overlay and the app using sockets.
What I want to achieve is that when button on overlay is clicked, then text on my main app has to change.
from flutter_overlay_window.
I was able to communicate between overlay and the app using sockets. My Main App creates a socket server and the overlay connects to that socket server.
My use case was that I wanted to invoke a native method by pressing the overlay. So what happens now is that, when I tap the overlay, it send a string over the socket connection and when my main app receives the message, it decides which native method to invoke.
I know this is not a fix, but rather a workaround in case the fix is not coming around any time soon. Hope it helps.
I have a question for this. I am trying this package. are we use local socket? and do you have example code for this? and ı need help
from flutter_overlay_window.
any update ? I have the same issue here
from flutter_overlay_window.
I have a question for this. I am trying this package. are we use local socket? and do you have example code for this? and ı need help
Example for use socket communicate between overlay and the app . Pls check this . (https://medium.com/flutter-community/working-with-sockets-in-dart-15b443007bc9)
from flutter_overlay_window.
Amigos pueden usar al comunicación mediante puertos Isolate.
Overlay********
En mi caso uso en overlay los siguiente atributos.
static const String _kPortName = 'overlay_port';
final _receivePort = ReceivePort();
static const String _kPortNameHome = 'home_port';
SendPort? homePort;
En initiState del overlay registro el puerto con el nombre;
IsolateNameServer.registerPortWithName(_receivePort.sendPort, _kPortName);
_receivePort.listen((message) {
//Aqui se recibe los mensajes del enviados del home al overlay
print("message overlay: $message");
});
En el evento onTop() de algun widget del overlay, trato de obtener el puerto del home o main, como ustedes lo usen.
homePort ??= IsolateNameServer.lookupPortByName(_kPortNameHome);
##para enviar mensaje del overlay al home usen, luego de haber registrado su homePort con la linea anterior.
homePort.send("texto"), homePort.send(list), homePort.send( { pro:"prop" } ), etc...
MAIN o Home o como lo usen****
Propiedades del main, o home, o como lo usen.
static const String _kPortName = 'overlay_port';
final _receivePort = ReceivePort();
static const String _kPortNameHome = 'home_port';
SendPort? homePort;
metodo initState
IsolateNameServer.registerPortWithName(_receivePort.sendPort, _kPortName);
_receivePort.listen((message) {
//Aqui se recibe los mensajes del enviados del overlay al home
print("message overlay: $message");
});
##para enviar mensaje del home al overlay usen lo siguiente:
overlayPort.send("texto"), overlayPort.send(list), overlayPort.send( { pro:"prop" } ), etc...
from flutter_overlay_window.
from flutter_overlay_window.
Related Issues (20)
- Does it use Google Play services? HOT 1
- You can use the resize overlay and pass the enableDrag params HOT 2
- Could not run the example
- FlutterOverlayWindow.showOverlay(height: WindowSize.fullcover) wont work
- Listview scroll event conflicts with FlutterOverlayWindow drag, HOT 1
- Save overlay position
- Open the main app from floating window? HOT 5
- MissingPluginException HOT 1
- Open Overlay from background when app is kill state HOT 3
- Android 14 requirese foregroundServiceType HOT 1
- Crash in production HOT 4
- Does not display all objects
- I can't display my data on the overlay window. HOT 3
- warning red
- Back button not working! HOT 1
- Open overlay causes crashing when upgrade Android SDK to 34 HOT 1
- Use of `FlutterEngineGroup` instead of simply using `FlutterEngine` HOT 1
- Overlay stops sending messages to UI when it's turned on after previously being closed after app termination
- Unable to create multiple overlay window. HOT 4
- Please add more flags to show when phone is looked HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_overlay_window.