Code Monkey home page Code Monkey logo

pvsvamsi / systemalertwindow Goto Github PK

View Code? Open in Web Editor NEW
106.0 2.0 64.0 13.53 MB

A flutter plugin to show Truecaller like overlay window, over all other apps along with callback events. In Android Go or Android 11 & above, this plugin shows notification bubble, in other android versions, it shows an overlay window.

License: Apache License 2.0

Java 72.27% Swift 1.93% Objective-C 0.54% Dart 23.89% Ruby 1.37%
overlay-window truecaller flutter-plugin overlay popup-window background-service display-over-other-apps flutter

systemalertwindow's Introduction

Hello, I'm Venkata Sai Vamsi 👋

pvsvamsi

Vamsi's Twitter Vamsi's Instagram Vamsi's Facebook

Linkedin: venkata-sai-vamsi-penupothu Twitter: pvsvamsi GitHub pvsvamsi

Languages and Tools:

Vamsi's github stats

Show some ❤️ by starring some of the repositories!

systemalertwindow's People

Contributors

ahmedny avatar aryaveer0710 avatar pvsvamsi avatar r111346 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

systemalertwindow's Issues

Close the window and it throws error: FATAL EXCEPTION: main and killed my app completely.

When try to press reject call button and call:

Future<void> _checkPermissions() async {
    await SystemAlertWindow.checkPermissions;
    ReceivePort _port = ReceivePort();
    IsolateManager.registerPortWithName(_port.sendPort);
    _port.listen((dynamic callBackData) {
      String tag= callBackData[0];
      switch (tag) {
        case "reject_call":
          print("Call reject");
          SystemAlertWindow.closeSystemWindow();
          break;
        case "accept_call":
          print("Accept Call");

          break;
      }
    });
    SystemAlertWindow.registerOnClickListener(callBackFunction);
  }

Throw error and killed my app

V/SystemAlertWindowPlugin(32685): invoking callback for tag reject_call
V/SystemAlertWindowPlugin(32685): Invoking on method channel
I/flutter (32685): Got tag reject_call
I/flutter (32685): Call reject
I/SystemAlertWindowPlugin(32685): Invoke call back success
D/AndroidRuntime(32685): Shutting down VM
E/AndroidRuntime(32685): FATAL EXCEPTION: main
E/AndroidRuntime(32685): Process: com.oudomsup.ocwa, PID: 32685
E/AndroidRuntime(32685): java.lang.AssertionError
E/AndroidRuntime(32685): 	at in.jvapps.system_alert_window.services.WindowServiceNew.onStartCommand(WindowServiceNew.java:95)
E/AndroidRuntime(32685): 	at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4204)
E/AndroidRuntime(32685): 	at android.app.ActivityThread.access$2100(ActivityThread.java:231)
E/AndroidRuntime(32685): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1984)
E/AndroidRuntime(32685): 	at android.os.Handler.dispatchMessage(Handler.java:107)
E/AndroidRuntime(32685): 	at android.os.Looper.loop(Looper.java:214)
E/AndroidRuntime(32685): 	at android.app.ActivityThread.main(ActivityThread.java:7682)
E/AndroidRuntime(32685): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(32685): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
E/AndroidRuntime(32685): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
I/Process (32685): Sending signal. PID: 32685 SIG: 9

Getting user input

Hey. Thanks for a very useful package! I know that this request is a little adjacent from the main aim of the package which is to display notifications, but I think it would be awesome for there to be a way to add a textfield to the body of the window. Really hoping you consider this if you're chanced.

FloatingActionButton

https://www.journaldev.com/14673/android-floating-widget

it's the main reason of the overlay widgets .., so it's the most important one, more than the truecaller window ..
we need this widget with very simple action ..
when we press on it just bring the app in foreground ..

i can't do this ..

and why you force the windows background color to white ?
i want to control it and change it's color to transparent for example or black ..

and there's another problem .. if you make small size window , when you move it any direction , it automatically go back to the right side ..

please fix this things ,thx.

registerOnClickListener not working

Describe the bug
After I upgrade to lastest version, my app no longer crashes. But, I can n't click button in screen. I think registerOnClickListener not working, callBack function has not been run.

Versions (please complete the following information):

  • SystemAlertWindow: 0.2.1+3
  • Device: Samsung Galaxy J5 Prime
  • OS: Android 6.0.1

How can I send a message from the callback to the app?

@pvsvamsi How can I send a message from the callback to the app? You told me I should use the IsolateManager but I can't seem to find that class in the flutter docs. And I can't find an isolate being spawned anywhere. I more info about this would also be good to have in the SystemAlertWindow docs.

  static Future<void> systemOverlayOnClickListner(String value) async {
    if (value == 'button_app_to_foreground') {
      await SystemAlertWindow.closeSystemWindow();
      // how can I send a message to te main isolate here?
    }
  }

Unhandled Exception: MissingPluginException(No implementation found for method closeSystemWindow on channel in.jvapps.system_alert_window)

I managed to :

  • open the system alert window using your example
  • Register the onclicks callbacks.

However when clicking on the simple button of your example window it triggers:

E/flutter (10888): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method closeSystemWindow on channel in.jvapps.system_alert_window)
E/flutter (10888): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:154:7)
E/flutter (10888): <asynchronous suspension>
E/flutter (10888): #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12)
E/flutter (10888): #2      SystemAlertWindow.closeSystemWindow (package:system_alert_window/system_alert_window.dart:114:27)

I am running it on AndroidX (API 29)

Plugin Problem

I am using sql database callback not working in background services.

Issue
No implementation found for method getApplicationDocumentsDirectory on channel plugins.flutter.io/path_provider

How can I close the window with a button in the window?

@pvsvamsi I can't seem to close my alert window properly. I have a alert window and I want the window to be removed when pressing on the button in the window.

This code works the first time but the second time the window keeps existing even tho the remove alert window method is being called. What would be the recommended approach?

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:system_alert_window/system_alert_window.dart';

class SystemOverlayController {
  static SystemOverlayController _instance;
  String _platformVersion = 'Unknown';
  bool _isShowingWindow = false;

  static SystemOverlayController get instance {
    if(_instance == null)
      _instance = SystemOverlayController._privateConstructor();
    return _instance;
  }

  SystemOverlayController._privateConstructor();

  void initialize() async {
    try {
      _platformVersion = await SystemAlertWindow.platformVersion;
      await SystemAlertWindow.checkPermissions;
      await SystemAlertWindow.registerOnClickListener(systemOverlayOnClickListner);
    } on PlatformException {
      _platformVersion = 'Failed to get platform version.';
    }finally{
      print('initializing complete');
    }
  }

  static systemOverlayOnClickListner(String value) {
    if (value == 'button_app_to_foreground') {
      // The line below isn't outputting correctly. It will always say false. I assume this is because 
      // the callback is being ran on another thread. If I could get the correct value I could check
      // if I should close the window
      print(SystemOverlayController.instance._isShowingWindow);
      // This always gets executed at the right time but it doesn't always close the overlay
      SystemAlertWindow.closeSystemWindow();
    }
  }

  Future<void> showSimpleSystemOverlay() async {
    if(_isShowingWindow){
      await SystemAlertWindow.closeSystemWindow();
      _isShowingWindow = false;
    }

    SystemWindowHeader header = SystemWindowHeader(
      title: SystemWindowText(text: "Title", fontSize: 10, textColor: Colors.black45),
      padding: SystemWindowPadding.setSymmetricPadding(12, 12),
      subTitle:
          SystemWindowText(text: "Subtitle", fontSize: 14, fontWeight: FontWeight.BOLD, textColor: Colors.black87),
      decoration: SystemWindowDecoration(startColor: Colors.grey[100]),
    );

    SystemWindowFooter footer = SystemWindowFooter(
        buttons: [
          SystemWindowButton(
            text: SystemWindowText(text: "Go To App", fontSize: 12, textColor: Color.fromRGBO(250, 139, 97, 1)),
            tag: "button_app_to_foreground",
            padding: SystemWindowPadding(left: 10, right: 10, bottom: 10, top: 10),
            width: 0,
            height: SystemWindowButton.WRAP_CONTENT,
            decoration: SystemWindowDecoration(
                startColor: Colors.white, endColor: Colors.white, borderWidth: 0, borderRadius: 0.0),
          ),
        ],
        padding: SystemWindowPadding(left: 16, right: 16, bottom: 12),
        decoration: SystemWindowDecoration(startColor: Colors.white),
        buttonsPosition: ButtonPosition.TRAILING);

    SystemAlertWindow.showSystemWindow(
        height: 150,
        width: 230,
        header: header,
        footer: footer,
        margin: SystemWindowMargin(left: 8, right: 8, top: 0, bottom: 0),
        gravity: SystemWindowGravity.CENTER);
        
    _isShowingWindow = true;
  }
}



I am calling the showSimpleOverlay from my onBackgroundMessage() which is a method coming from the cloud messaging package, and is also ran in the background.

  static Future<dynamic> myBackgroundMessageHandler(Map<String, dynamic> message) async {
    print('on background message');
    await SystemOverlayController.instance.showSimpleSystemOverlay();
  }

I think it has something to do with the fact that I can't check if a window is open in systemOverlayOnClickListner() so I am calling it while no window is open but not sure.

Passing arguments when using IsolateManager

Hello,
Thanks for your effort.

I want to know how to pass args when using isolate manager

_port.listen((dynamic callBackData) {
    String tag = callBackData[0];
    Get.printInfo(info: 'callBackData: ${(callBackData.toString())}');
    switch (tag) {
      case "closeBtnTag":
        print("closeBtnTag button has been clicked");
        SystemAlertWindow.closeSystemWindow();
        break;
      case "actionBtnTag":
        print("actionBtnTag button has been clicked");
        SystemAlertWindow.closeSystemWindow();
       //Here, how to get the input body-----------------------------
        break;
      default:
        print("OnClick event of $tag");
    }
  });

Here, the tag only is found.
And SystemAlertWindow.registerOnClickListener(callBackFunction); send only the tag.

Thanks

Callback params

Hi!

It's possible to send params to callback function?

my Callback function:

void callBack(String tag) async {

swicth(tag){
case "footer_button":
registerCallBack(trip, tag);
}

"I need a param here --> trip. I've tried to pass by global variable, but i got only null value"

Callback params

Hi!

It's possible send params to callback function?

my Callback function:

void callBack(String tag) async {

swicth(tag){
case "footer_button":
registerCallBack(trip, tag);
}

"I need a param here --> trip. I've tried to pass by global variable, but i got only null value"

I cant change the callback status from out side.

For example,these is my code
image
I cant change the “isStarting” from out side。
it is very queer。
if i close the window and reCreate it.
i cant init the status. or it is not working.
pls tell me how to do it

Call back not registered

buttons clicks are not working , it said "toRawHandle" call on null , in your clone project callbacks are working but in my project its not working ..
@OverRide
void initState() {
super.initState();
_initPlatformState();
_checkPermissions();
SystemAlertWindow.registerOnClickListener((tag) {
switch (tag) {
case "simple_button":
SystemAlertWindow.closeSystemWindow();
break;
case "updated_simple_button":
SystemAlertWindow.closeSystemWindow();
break;
case "focus_button":
print("Focus button has been called");
break;
default:
print("OnClick event of $tag");
}
});
}

this is the code.
and for show overlay window I create separate class . Like this:
CallDialog().showOverlayWindow();

Being able to drag the window even if it is resized to small rectangle

Currently the window is draggable only if the width is not set. In my project, I use this package as a small icon badge to be able to get into app quickly when the app is minimized.

Desired behavior would be, so that user can drag this icon badge just like messenger chat heads.

Is it somehow possible to fix / implement this functionality?

Thanks in advance :)

Ok in demo, not in my project

[ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method closeSystemWindow on channel in.jvapps.system_alert_window)

is it possible to customize ?

first of all thanks for plugging.

is it possible to customize system alert window. i dont need hearder or body. all i want is simply button. nothing else. but some how i can not do that.

Support normal widgets layout

I'm always frustrated when using certain widgets

Describe the solution you'd like
If the Alert layout could be built using normal widgets

How to close System alert window when app gets destroyed

Hello, in my app, what i want to achieve is to close the currently opened SystemAlertWindow when app gets destroyed.

I tried it through AppLifecycleState.detached but this callback is not firing in my case.

Then I tried, in Application.kt, to add onDestroy() and call some method on method channel, so it fires and event in flutter where I would call SystemAlertWindow.closeSystemWindow(), but that didnt work, because the widget was already dead at that moment.

Im guessing the best solution would be to call it directly in onDestroy in Application.kt, but I have absolutely no idea, what method should I invoke and how. Can you somehow help me with this? :) thanks in advance

Is there any way to navigate back to the app from the system alert window

Hey,

I have the system alert window. And I noticed it is using the android bubble api. And I know that the Messenger app from facebook can resume or start an app when the user clicks on the bubble. But there is absolutely nothing I can find about how they do this.

Would you by chance happen to have any idea. I have been searching for days and I don't know where else to go.

Button callback is not invoked

Describe the bug
Hello dear @pvsvamsi and thank you for sharing!
I seem to be having trouble with buttons call back saying
Error -32601 received from application: Method not found
Here is some usefull info:

To Reproduce
Steps to reproduce the behavior (use the code below):

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:inspirationwall/ui/views/home/home_view.dart';
import 'package:flutter/services.dart';
import 'package:system_alert_window/system_alert_window.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  // This widget is the root of your application.
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String _platformVersion = 'Unknown';
  bool _isShowingWindow = false;

  @override
  void initState() {
    super.initState();
    _initPlatformState();
    _checkPermissions();
    SystemAlertWindow.registerOnClickListener(callBack);
    showAlertDialog();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> _initPlatformState() async {
    String platformVersion;
    // Platform messages may fail, so we use a try/catch PlatformException.
    try {
      platformVersion = await SystemAlertWindow.platformVersion;
    } on PlatformException {
      platformVersion = 'Failed to get platform version.';
    }

    // If the widget was removed from the tree while the asynchronous platform
    // message was in flight, we want to discard the reply rather than calling
    // setState to update our non-existent appearance.
    if (!mounted) return;

    setState(() {
      _platformVersion = platformVersion;
    });
  }

  Future<void> _checkPermissions() async {
    await SystemAlertWindow.checkPermissions;
  }

  showAlertDialog() {
    print("test");
    Timer(
      Duration(seconds: 5),
      () {
        _showOverlayWindow();
      },
    );
  }

  void _showOverlayWindow() {
    if (!_isShowingWindow) {
      SystemWindowHeader header = SystemWindowHeader(
          title: SystemWindowText(
              text: "Incoming Call", fontSize: 10, textColor: Colors.black45),
          padding: SystemWindowPadding.setSymmetricPadding(12, 12),
          subTitle: SystemWindowText(
              text: "9898989899",
              fontSize: 14,
              fontWeight: FontWeight.BOLD,
              textColor: Colors.black87),
          decoration: SystemWindowDecoration(startColor: Colors.grey[100]),
          button: SystemWindowButton(
              text: SystemWindowText(
                  text: "Personal", fontSize: 10, textColor: Colors.black45),
              tag: "personal_btn"),
          buttonPosition: ButtonPosition.TRAILING);
      SystemAlertWindow.showSystemWindow(
          height: 100,
          header: header,
          margin: SystemWindowMargin(left: 20, right: 20, top: 200, bottom: 0),
          gravity: SystemWindowGravity.TOP);
      setState(() {
        _isShowingWindow = true;
      });
    } else {
      setState(() {
        _isShowingWindow = false;
      });
      SystemAlertWindow.closeSystemWindow();
    }
  }

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return GetMaterialApp(
      title: 'Inspiration Wall',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: HomeView(),
    );
  }
}

void callBack(String tag) {
  print(tag);
  switch (tag) {
    case "simple_button":
    case "updated_simple_button":
      SystemAlertWindow.closeSystemWindow();
      break;
    case "focus_button":
      SystemAlertWindow.closeSystemWindow();

      print("Focus button has been called");
      break;
    case "personal_btn":
      SystemAlertWindow.closeSystemWindow();
      break;
    default:
      print("OnClick event of $tag");
  }
}

Expected behavior
I would expect to run the code inside
case "focus_button": SystemAlertWindow.closeSystemWindow();
in this case when the button is tapped.

Screenshots
If applicable, add screenshots to help explain your problem.

image
image

Versions (please complete the following information):

  • SystemAlertWindow: 0.2.2+2
  • Device: Xiaomi Mi9
  • OS: Android 10

Additional context
I have placed the callBack method outside of my main class as you described in the readme but it still seems to be unable to find it.
The callback is placed inside main.dart file as is the rest of the code.

EDIT: I do get the following in the console:
I/SystemAlertWindowPlugin(15951): Unable to start callBackHandle... as plugin is not registered

Is this related to :

public class Application extends FlutterApplication implements 
PluginRegistry.PluginRegistrantCallback {

      @Override
      public void onCreate() {
          super.onCreate();
          //This is required as we are using background channel for dispatching click events
          SystemAlertWindowPlugin.setPluginRegistrant(this);
      }

      @Override
      public void registerWith(PluginRegistry pluginRegistry) {
          GeneratedPluginRegistrant.registerWith(pluginRegistry);
      }

  }

Do i have to put this somewhere? Sorry i'm a bit newbie with all this!

main/java/io.flutter.plugins/GeneratedPluginRegistrant:

@Keep
public final class GeneratedPluginRegistrant {
  public static void registerWith(@NonNull FlutterEngine FlutterEngine) {
    ShimPluginRegistry shimPluginRegistry = new ShimPluginRegistry(flutterEngine);
      in.jvapps.system_alert_window.SystemAlertWindowPlugin.registerWith(shimPluginRegistry.registrarFor("in.jvapps.system_alert_window.SystemAlertWindowPlugin"));
  }
}

EDIT: Tried with newly created application and its the same error. I think it has something to do with:

        </activity>
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />

in AndroidManifes.xml.

bug when running app

Note: C:\dev\flutter.pub-cache\hosted\pub.dartlang.org\system_alert_window-0.2.2+2\android\src\main\java\in\jvapps\system_alert_window\services\WindowService.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\dev\flutter.pub-cache\hosted\pub.dartlang.org\system_alert_window-0.2.2+2\android\src\main\java\in\jvapps\system_alert_window\SystemAlertWindowPlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
e: E:\flutter apps\toast_flutter\android\app\src\main\kotlin\com\example\toastflutter\Application.kt: (16, 48): Type mismatch: inferred type is PluginRegistry but FlutterEngine was expected
e: E:\flutter apps\toast_flutter\android\app\src\main\kotlin\com\example\toastflutter\MainActivity.kt: (10, 48): Type mismatch: inferred type is MainActivity but FlutterEngine was expected

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:compileDebugKotlin'.

Compilation error. See log for more details

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 2m 39s
Exception: Gradle task assembleDebug failed with exit code 1

closeSystemWindow is not working properly

When I try to call closeSystemWindow as an example, It will print some errors:

[ xx ms ] D/skia     (18240): Shader compilation error
[       ] D/skia     (18240): ---------------------------
[       ] D/skia     (18240): Errors:
[       ] D/skia     (18240):

and the window was not closed, even if those states ware changed.

On: Android9 AOSP emulator with Flutter 1.22.3

Flutter 2.0

Congratulations on the work. Do you have an update forecast?

SystemAlertWindow.closeSystemWindow(); is not working from Alart window

E/flutter (24122): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: MissingPluginException(No implementation found for method closeSystemWindow on channel in.jvapps.system_alert_window)

E/flutter (24122): #0 MethodChannel._invokeMethod
package:flutter/…/services/platform_channel.dart:154
E/flutter (24122):
E/flutter (24122): #1 MethodChannel.invokeMethod
package:flutter/…/services/platform_channel.dart:329
E/flutter (24122): #2 SystemAlertWindow.closeSystemWindow
package:system_alert_window/system_alert_window.dart:114
E/flutter (24122): #3 callBack
package:native_code/screens/overlay.dart:323
E/flutter (24122): #4 callbackDispatcher.
package:system_alert_window/system_alert_window.dart:136
E/flutter (24122): #5 MethodChannel._handleAsMethodCall
package:flutter/…/services/platform_channel.dart:409
E/flutter (24122): #6 MethodChannel.setMethodCallHandler.
package:flutter/…/services/platform_channel.dart:377
E/flutter (24122): #7 _DefaultBinaryMessenger.handlePlatformMessage
package:flutter/…/services/binding.dart:258
E/flutter (24122): #8 _invoke3. (dart:ui/hooks.dart:306:15)
E/flutter (24122): #9 _rootRun (dart:async/zone.dart:1184:13)
E/flutter (24122): #10 _CustomZone.run (dart:async/zone.dart:1077:19)
E/flutter (24122): #11 _CustomZone.runGuarded (dart:async/zone.dart:979:7)
E/flutter (24122): #12 _invoke3 (dart:ui/hooks.dart:305:10)
E/flutter (24122): #13 _dispatchPlatformMessage (dart:ui/hooks.dart:180:5)
E/flutter (24122):

There are errors on Application.java

package com.example.covid19route;

import io.flutter.app.FlutterApplication;
import io.flutter.plugin.common.PluginRegistry;
import io.flutter.plugins.GeneratedPluginRegistrant;
public class Application extends FlutterApplication implements PluginRegistry.PluginRegistrantCallback {

@Override
public void onCreate() {
    super.onCreate();
    //This is required as we are using background channel for dispatching click events
    SystemAlertWindowPlugin.setPluginRegistrant(this);
}

@Override
public void registerWith(PluginRegistry pluginRegistry) {
    GeneratedPluginRegistrant.registerWith(pluginRegistry);
}

}

Here is my Application.java code in kotlin Folder

Android Studio say me that "cannot resolve symbol SystemAlertWindowPlugin" and "registerWith (io.flutter.embedding.engine.FlutterEngine) in GeneratedPluginRegistrant cannot be applied to (io.flutter.plugin.common.PluginRegistry))"

What is the main problem and what should I do?

SystemWindowButton onPress

can you please tell me how to setup onPressed event for this button?

I mean how to set logic for click on buttons. ??

How to use?

The plugin looks great. When the app is in the background how is it launched? Through a Push notification? I don't understand how the window is launched? Thank you

Unable to access static members of classes in callback function

Hello, I have a following problem. In callback function I need to access another classes static object, but the problem is, as soon as it gets to the callback function, the object seems to be null. I really need this, to access singleton instance and execute some methods, but after almost 2 days I am still unable to do this. Here is a simple example of what I am trying to achieve (it is your example modified):

class TestClass {
  static TestModel myStaticModel;

  static void fillModel(){
    myStaticModel = new TestModel("John doe", 5);
  }
}

class TestModel {
  String name;
  int age;

  TestModel(this.name, this.age);
}

void callBack(String tag) {
  switch(tag){
    case "myButton":
      print(TestClass.myStaticModel);   //this prints null
      break;
    default:
      print("OnClick event of $tag");
  }
}

TestClass.fillModel() is called when invoking showOverlayWindow()

Any help will be appriciated

Call back not working

V/SystemAlertWindowPlugin(30292): invoking callback for tag focus_button
V/SystemAlertWindowPlugin(30292): Invoking on method channel

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.