x-slayer / flutter_overlay_window Goto Github PK
View Code? Open in Web Editor NEWFlutter plugin for displaying flutter app over other apps on the screen
Home Page: https://pub.dev/packages/flutter_overlay_window
License: MIT License
Flutter plugin for displaying flutter app over other apps on the screen
Home Page: https://pub.dev/packages/flutter_overlay_window
License: MIT License
I want to receive data from Overlays but i don't ? are you can help me?
I need to set only Messenger Chat Head... How can I do it??, because when I open the overlay, at first, it covers the entire screen... and then when I tap once, it becomes like a chat head...
Also, how can I open the APP by clicking on the overlay??
Kindly suggest me best ways to implement my two conditions!!
Thanks in Advance...
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.
hey, the product is good.
just when i use FlutterOverlayWindow.showOverlay to show the overlay window in my pixel 2 phone,
it will pop the tip, and the tip have a logo,not my app logo, it's the flutter default logo,
can i have a method to change the logo or not to pop the tip.
have a good day, ths.
hey:
when i close the window with: FlutterOverlayWindow.closeOverlay();
the app will be crash, get log:
E/flutter (23445): [ERROR:flutter/fml/platform/android/jni_util.cc(204)] java.lang.NullPointerException: Attempt to invoke interface method 'boolean android.view.ViewParent.requestSendAccessibilityEvent(android.view.View, android.view.accessibility.AccessibilityEvent)' on a null object reference
E/flutter (23445): at io.flutter.view.AccessibilityBridge.sendAccessibilityEvent(AccessibilityBridge.java:1908)
E/flutter (23445): at io.flutter.view.AccessibilityBridge.sendWindowContentChangeEvent(AccessibilityBridge.java:1967)
E/flutter (23445): at io.flutter.view.AccessibilityBridge.updateSemantics(AccessibilityBridge.java:1719)
E/flutter (23445): at io.flutter.view.AccessibilityBridge$1.updateSemantics(AccessibilityBridge.java:345)
E/flutter (23445): at io.flutter.embedding.engine.FlutterJNI.updateSemantics(FlutterJNI.java:762)
E/flutter (23445): at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter (23445): at android.os.MessageQueue.next(MessageQueue.java:374)
E/flutter (23445): at android.os.Looper.loopOnce(Looper.java:163)
E/flutter (23445): at android.os.Looper.loop(Looper.java:293)
E/flutter (23445): at android.app.ActivityThread.main(ActivityThread.java:9551)
E/flutter (23445): at java.lang.reflect.Method.invoke(Native Method)
E/flutter (23445): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:586)
E/flutter (23445): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1204)
E/flutter (23445):
F/flutter (23445): [FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(1233)] Check failed: fml::jni::CheckException(env).
any i will atention?
E/flutter ( 7080): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method close on channel x-slayer/overlay)
E/flutter ( 7080): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:294:7)
E/flutter ( 7080): <asynchronous suspension>
E/flutter ( 7080): #1 FlutterOverlayWindow.closeOverlay (package:flutter_overlay_window/flutter_overlay_window.dart:83:24)
flutter_overlay_window: ^0.3.2
直接下载github上的包到本地使用就正常:
flutter_overlay_window:
path: ./lib/plugins/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.shareData("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
solved
Hi.
I are developing the Auto send SMS/MMS after call with flutter.
I want to develop like this.
Currently,
But, It works good before Flutter App closed.
It only works for a few minutes after the Flutter App closed.
Should I develop it by a native Android?
When the overlay is open and we try to record screen/share our screen, only black screen is recorded/shared. The seen screen content is not recorded.
Is this a bug with this package or is there something I need to do while using this package ?
When I run the example
app I get the following error
java.lang.RuntimeException: Unable to create service flutter.overlay.window.flutter_overlay_window.OverlayService: java.lang.IllegalArgumentException: com.example.flutter_overlay_window_example: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. E/AndroidRuntime(17128): Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
It seems that in onCreate
method of OverlayService
, one needs to pass PendingIntent.FLAG_IMMUTABLE
while creating the pending intent.
And also how to show some animation when showing the overlay. Right now it just pops up. It would be nice if there is some nice configurable animation.
Hi @X-SLAYER resizing the overlay widget is not working as expected. If we resize the UI component with specific height and width it leads to overflow pixel issues, as the UI was changing at the Run Time instead of compile. But if, we use match_parent for both height and width without having any content in the UI. For instance, Container with match_parent for both height and width. It was working fine.
But not for Container having another Row or Column of widgets. It's not working perfectly.
Hi,
overlay_windows run perfectly fine, but I can't close overlay_window.
E/flutter (15267): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: MissingPluginException(No implementation found for method close on channel x-slayer/overlay) E/flutter (15267): #0 MethodChannel._invokeMethod E/flutter (15267): <asynchronous suspension> E/flutter (15267): #1 FlutterOverlayWindow.closeOverlay E/flutter (15267): <asynchronous suspension> E/flutter (15267): #2 _HomePageState.build.<anonymous closure> E/flutter (15267): <asynchronous suspension> E/flutter (15267):
Error : When you open overlay_windown and terminal the app , and open again (the overlay still run in background but i can not cancel Timer ().
.
Steps to Reproduce :
Download example in Git and add Timer in initState like code below
in Home Page
Run the app , and open overlay windown . => terminate app (kill the app by swipe)
=>Open app and Click Close Timer .
Thanks you .
in debug mode, funcion is ok. but when release, can't show the overlay window ,why?
when using CloseOverlays has error this, are you can support fo me this issues?
hey, above method is not support? or a bug?
wish to get reply, ths.
i have folow code like sample but created a bug this.`void main() {
runApp(const MyApp());
}
@pragma("vm:entry-point")
void overlayMain() {
runApp(
const MaterialApp(
debugShowCheckedModeBanner: false,
home: OverlayScreen(),
),
);
}
`
and overlays
@override Widget build(BuildContext context) { return Material( color: Colors.transparent, child: Center( child: Container( height: 100, padding: const EdgeInsets.symmetric(vertical: 12.0), decoration: BoxDecoration( gradient: LinearGradient( begin: Alignment.topCenter, end: Alignment.bottomRight, colors: isGold ? _goldColors : _silverColors, ), borderRadius: BorderRadius.circular(12.0), ), child: Container( child: Column( children: [ ElevatedButton( onPressed: () async { print("click button share "); await FlutterOverlayWindow.shareData(" data from Overlays"); }, child: const Text("Share data")) ], ), ), ), ), ); } }
How to automatically close the overlay by clicking on outside overlay
Exception is thrown when at the last line of this code -
final status = await FlutterOverlayWindow.isPermissionGranted();
if (status) {
await FlutterOverlayWindow.showOverlay(
alignment: OverlayAlignment.bottomCenter,
overlayTitle: "Call Ended",
visibility: NotificationVisibility.visibilitySecret,
overlayContent: "Call ended with $number",
);
await FlutterOverlayWindow.resizeOverlay(80, 120);
Working with this dependency -
flutter_overlay_window:
git:
url: https://github.com/X-SLAYER/flutter_overlay_window.git
ref: FULL_SCREEN
It has the same result on latest pub version
Hi
I try to close overlay.
but I got some issue..
please help me!
thanks.
[debug]
E/flutter (25852): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method close on channel x-slayer/overlay_channel)
E/flutter (25852): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:294:7)
E/flutter (25852):
E/flutter (25852): #1 FlutterOverlayWindow.closeOverlay (package:flutter_overlay_window/flutter_overlay_window.dart:83:24)
E/flutter (25852):
E/flutter (25852):
Hello,
I am trying to copy a text that appears in the overlay but it is not copied using
Clipboard.setData(ClipboardData(text: "your text"));
My code to start the overlay is as follows
await FlutterOverlayWindow.showOverlay( width: 150, height: 691, //765, enableDrag: false, overlayTitle: t.generals.notify.overlays.title, overlayContent: t.generals.notify.overlays.description, flag: OverlayFlag.defaultFlag, alignment: OverlayAlignment.centerRight, visibility: NotificationVisibility.visibilityPublic, positionGravity: PositionGravity.auto, );
Hi,
I know that the overlay window needs to be alive main flutter.
But, I want to run it from background after main flutter app is closed..
Is there a way?
I've a periodic method to update location... it works fine when the app is opened... but after the overlay is opened by minimizing or closing the app, that method is not working... any suggestion to execute a method periodically, for like 10 seconds once, when the overlay is opened...
Thanks in Advance...
With 0.3.2 of the plugin, calling "FlutterOverlayWindow.closeOverlay()" throws MissingPluginException(No implementation found for method close on channel x-slayer/overlay).
When I checked the source code of the fluter_ovelay_window 0.3.2 on my IDE, the copy of "FlutterOverlayWindowPlugin.java" was missing lines 104-111 of the file in this git repository "FlutterOverlayWindowPlugin.java.
Am I missing something?
MissingPluginException(No implementation found for method close on channel x-slayer/overlay)
I add google_mobile_ads but banner only show white
D/EgretLoader(29530): EgretLoader(Context context)
D/EgretLoader(29530): The context is not activity
E/flutter (29530): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method create on channel flutter/platform_views)
E/flutter (29530): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:294:7)
E/flutter (29530):
E/flutter (29530): #1 TextureAndroidViewController._sendCreateMessage (package:flutter/src/services/platform_views.dart:1146:18)
E/flutter (29530):
E/flutter (29530): #2 AndroidViewController.create (package:flutter/src/services/platform_views.dart:792:5)
E/flutter (29530):
I need two different overlay windows for my app, currently i had one that is working fine, but i want to show 2nd window that is related to other feature of my app. can i do following for 2nd overlay as i had done for the first overlay. If can do so, how the code differentiate between two windows.
// overlay entry point
@pragma("vm:entry-point")
void overlayMain() {
runApp(const MaterialApp(
debugShowCheckedModeBanner: false,
home: Material(child: Text("My overlay"))
));
}
or i had to change the child of Material widget to display other widget as overlay . This means i technically have only have one overlay whose content is changed.
I looked into flutter_floatwing plugin also but i can't able to understand that their example was unnecessarily complex. But they use id pram to differentiate between multiple windows.
There is also another one called system_alert_window but that give less options to customize the window
if anyone had implemented 2-3 different window please comment down any demo code or any info you can provide me.
Testing flutter_overlay_window plugin on emulated Android 30 crashes with a java.lang.IllegalArgumentException (Compiled with SDK 31; Emulater version is 31.2.10)
E/AndroidRuntime(31320): java.lang.RuntimeException: Unable to create service flutter.overlay.window.flutter_overlay_window.OverlayService: java.lang.IllegalArgumentException: home.project.demo_overlay_window: Targeting S+ (version 10000 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
E/AndroidRuntime(31320): Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
I believe that Issue #4 has addressed the similar issue for API 31 and above. Would it possible to lower the API level that PendingIntent.FLAG_IMMUTABLE flag is set with the outgoing pending intent, down to API 30?
Or possibly down to API 23 that the flag is first introduced.
Can you help me for it please ?
system_alert_window is working on background call but it is not good ui
Thanks for this awesome package!
I had no problem showing/closing an overlay when the app is in the foreground or paused. But, in my use case, I attempted to show an overlay from a background task (workmanager). And I got the java.lang.IllegalStateException: Not allowed to start service Intent
exception.
...
Background start not allowed: service Intent { flg=0x30000000 cmp=com.example.overlay_test/flutter.overlay.window.flutter_overlay_window.OverlayService } to com.example.overlay_test/flutter.overlay.window.flutter_overlay_window.OverlayService from pid=10481 uid=10125 pkg=com.example.overlay_test startFg?=false
Failed to handle method call
java.lang.IllegalStateException: Not allowed to start service Intent { flg=0x30000000 cmp=com.example.overlay_test/flutter.overlay.window.flutter_overlay_window.OverlayService }: app is in background uid UidRecord{4e22f0e u0a125 CEM idle change:cached procs:1 seq(0,0,0)}
at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1715)
at android.app.ContextImpl.startService(ContextImpl.java:1670)
at android.content.ContextWrapper.startService(ContextWrapper.java:720)
at flutter.overlay.window.flutter_overlay_window.FlutterOverlayWindowPlugin.onMethodCall(FlutterOverlayWindowPlugin.java:99)
at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
errorCode: error, errorMessage: Not allowed to start service Intent { flg=0x30000000 cmp=com.example.overlay_test/flutter.overlay.window.flutter_overlay_window.OverlayService }: app is in background uid UidRecord{4e22f0e u0a125 CEM idle change:cached procs:1 seq(0,0,0)}
...
Now I have zero experience with Java but as a programmer, I just took the error and pasted it onto google. After going through some stackoverflows I found out that the IntentService
used here -
final Intent intent = new Intent(context, OverlayService.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
context.startService(intent);
is deprecated and not allowed above Android 8.0 when the app is in background, or something along those lines.
As for fixes, I found that the new JobScheduler can be used or the service can be moved to foreground context.startForegroundService(intent);
. Of course, I'm not familiar with the internals that's why I can't tell which parts need to be affected after applying the above fixes.
If possible, please address the issue. Else, if possible, please provide me some helpers/pointers on the subject so that I can work on the same.
Hello, I have an issue and 2 questions.
The issue: On trying to close the overlay I get this error:
E/flutter ( 5856): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method close on channel x-slayer/overlay) E/flutter ( 5856): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:294:7) E/flutter ( 5856): <asynchronous suspension> E/flutter ( 5856): #1 FlutterOverlayWindow.closeOverlay (package:flutter_overlay_window/flutter_overlay_window.dart:83:24) E/flutter ( 5856): <asynchronous suspension> E/flutter ( 5856): [log] Try to close
Question 1:
Is there a way to make the overlay, when set to clickthrough, non-transparent? Right now whenever I set it to clickthrough it becomes semi transparent.
Question 2:
Is there a way to overlay the content above the system navigation bar or statusbar? Right now I'm only able to position it as if there was a safe area around it.
Thank you in advance!
I try to show a box over apps and inside of it I added a TextField , and when i press inside of it to write it dosent show the keyboard to enable me to write inside the TextField
I am testing the MessengerChatHead example https://pub.dev/packages/flutter_overlay_window/example and when I drag, y position seems to behave correctly, but the x position goes to the opposite direction. When I move left, it goes right and and when I move right, it goes left
Hi there,
Method channel calls inside the OverlayService class is not working.
E/flutter (14596): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: MissingPluginException(No implementation found for method updateFlag on channel x-slayer/overlay)
E/flutter (14596): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:165:7)
E/flutter (14596): <asynchronous suspension>
E/flutter (14596): #1 FlutterOverlayWindow.updateFlag (package:flutter_overlay_window/flutter_overlay_window.dart:103:24)
E/flutter (14596): <asynchronous suspension>
E/flutter (14596):
this issue is likely related to this.
https://developer.android.com/about/versions/12/behavior-changes-all#untrusted-touch-events
could you please expose the transparency value of the system alert window.
then we could adapt opacity to make clickthrough overlay work on Android 12 devices
hello
I want change overlay options like,
transparency, color, text, image etc..
please help me
Good work. Thanks for your contribution.
Alignment enum bugs exist where drag direction is inverted on horizontal, vertical or both axis depending on alignment:
TopLeft=OK
CenterLeft=OK
BottomLeft = Vertical drag axis inverted.
TopCenter = OK
Center = OK
BottomCenter = Vert drag axis inverted
TopRight = Horizontal drag inverted
CenterRight = Horizontal drag inverted
BottomRight = Both drag axis inverted.
I'm not a Java programmer but your ACTION_MOVE switch statement seems to look fine, and obviously works fine gravity set to center etc. It is a weird gravity issue, possibly a bug between window manager and the flutterview? Out of my depth sorry.
To rectify in the short term in your onTouch method if you can't find the cause :
int xx = params.x + (int) dx; (subtract dx instead on problematic right gravity)
int yy = params.y + (int) dy; (subtract dx instead on problematic bottom gravity)
Also there is a screen dims / vertical centering issue. If you pass a full screen colored container from flutter you might see the screen centering too far north, off the screen and padded at the bottom. NavBar size calculation issue??
Hi, I want to show the overlay when the main app is closed and a new incmoing call is received. I have created a BroadcastReceiver
which keeps running when the app is closed. On receiving a new call, it calls a background callback when the is closed. In this callback I am calling FlutterOverlayWindow.showOverlay
. The callback works fine when the app is closed, I have done some print to show this. However when the app is closed, it gives me the following error
app is in background uid UidRecord{c767979 u0a588 CEM idle change:cached procs:0 seq(0,0,0)}, null, android.app.BackgroundServiceStartNotAllowedException: Not allowed to start service Intent
Upon investigating the matter further, I found out https://stackoverflow.com/a/47654126/1671807 and applied the following changes in FlutterOverlayWindowPlugin.onMethodCall
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
context.startForegroundService(intent);
} else {
context.startService(intent);
}
But now I am getting the following error
E/AndroidRuntime(20853): java.lang.RuntimeException: Unable to create service flutter.overlay.window.flutter_overlay_window.OverlayService: java.lang.NullPointerException: Attempt to invoke virtual method 'io.flutter.embedding.engine.dart.DartExecutor io.flutter.embedding.engine.FlutterEngine.getDartExecutor()' on a null object reference
E/AndroidRuntime(20853): at android.app.ActivityThread.handleCreateService(ActivityThread.java:4701)
E/AndroidRuntime(20853): at android.app.ActivityThread.access$100(ActivityThread.java:258)
E/AndroidRuntime(20853): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2230)
E/AndroidRuntime(20853): at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(20853): at android.os.Looper.loopOnce(Looper.java:233)
E/AndroidRuntime(20853): at android.os.Looper.loop(Looper.java:344)
E/AndroidRuntime(20853): at android.app.ActivityThread.main(ActivityThread.java:8204)
E/AndroidRuntime(20853): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(20853): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:589)
E/AndroidRuntime(20853): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1071)
E/AndroidRuntime(20853): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'io.flutter.embedding.engine.dart.DartExecutor io.flutter.embedding.engine.FlutterEngine.getDartExecutor()' on a null object reference
E/AndroidRuntime(20853): at flutter.overlay.window.flutter_overlay_window.OverlayService.<init>(OverlayService.java:37)
E/AndroidRuntime(20853): at java.lang.Class.newInstance(Native Method)
E/AndroidRuntime(20853): at android.app.AppComponentFactory.instantiateService(AppComponentFactory.java:129)
E/AndroidRuntime(20853): at androidx.core.app.CoreComponentFactory.instantiateService(CoreComponentFactory.java:75)
E/AndroidRuntime(20853): at android.app.ActivityThread.handleCreateService(ActivityThread.java:4670)
E/AndroidRuntime(20853): ... 9 more
I am not sure how to solve this. Can you please help?
Hi there,
Unable to use the feature of resize overlay
D/EGL_emulation(13076): app_time_stats: avg=6515.98ms min=6515.98ms max=6515.98ms count=1
E/flutter (13076): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: MissingPluginException(No implementation found for method resizeOverlay on channel x-slayer/overlay)
E/flutter (13076): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:165:7)
E/flutter (13076): <asynchronous suspension>
E/flutter (13076): #1 FlutterOverlayWindow.resizeOverlay (package:flutter_overlay_window/flutter_overlay_window.dart:110:24)
E/flutter (13076): <asynchronous suspension>
E/flutter (13076): #2 _MessangerChatHeadState.resize (package:flutter_overlay_window_example/overlays/messanger_chathead.dart:21:5)
E/flutter (13076): <asynchronous suspension>
E/flutter (13076):
This was the code changes which I did
class MessangerChatHead extends StatefulWidget {
const MessangerChatHead({Key? key}) : super(key: key);
@override
State<MessangerChatHead> createState() => _MessangerChatHeadState();
}
class _MessangerChatHeadState extends State<MessangerChatHead> {
Color color = const Color(0xFFFFFFFF);
@override
void initState() {
super.initState();
resize();
}
resize() async{
await FlutterOverlayWindow.resizeOverlay(80, 120);
}
@override
Widget build(BuildContext context) {
return Material(
color: Colors.transparent,
elevation: 0.0,
child: FloatingActionButton(
elevation: 0,
splashColor: Colors.transparent,
child: const Text('02:00'),
onPressed: () {
FlutterOverlayWindow.closeOverlay();
},)
);
}
}
I'am getting this error
NoSuchMethodError (NoSuchMethodError: No top-level getter 'overlayMain' declared. Receiver: top-level Tried calling: overlayMain)
Any explantation ?
As I told on the title, if the overlay is double, I can't close the one of those. isActive method detect false and closeOverlay not working at that time whenever the overlay is double.
I am using Android Alarm Manager Plus to start an isolate at a fixed time. Now I want to call the overlay from that isolate. So far, I am not seeing any overlay, or any related error messages. My other audio code in the isolate is working though.
Entry point for isolate called by Android Alarm Manager Plus:
@pragma('vm:entry-point')
void ringAlarm() async {
var alarms = await FlutterSystemRingtones.getAlarmSounds();
final DateTime now = DateTime.now();
final player = AudioPlayer();
await player.setAudioSource(AudioSource.uri(Uri.parse(alarms[0].uri)));
player.play();
await FlutterOverlayWindow.showOverlay();
FlutterOverlayWindow.overlayListener.listen((event) {
if (event == "dismiss") {
FlutterOverlayWindow.closeOverlay();
player.stop();
}
});
}
Entry point for overlay:
@pragma("vm:entry-point")
void overlayMain() {
runApp(
MaterialApp(
home: Scaffold(
body: TextButton(
onPressed: () async {
await FlutterOverlayWindow.shareData("dismiss");
},
child: const Text("Dismiss"),
),
)),
);
}
Is it even possible?
flutter_overlay_window: ^0.3.3
on my lollipop android tv i get an error which is also described here
sometimes the bubble in the messenger chat head freezes and does not open when I click on it shows me this line at the console
performTraversals mFirst=false windowShouldResize=false viewVisibilityChanged=false mForceNextWindowRelayout=false params={(486,962)(82x82) gr=CENTER sim={adjust=pan} ty=APPLICATION_OVERLAY fmt=TRANSLUCENT
The opening and closing of overlay works flawlessly , the data sharing also works when app is open and foreground service is running but when app get closed the data sharing doesn't work and the
FlutterOverlayWindow.shareData()
returns null,
it does not causes any error,
could you point me in direction why this is happening, does it had to do something with the app isolate .
i fixed that issue by relying on the main thread
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.