A flutter plugin to show Truecaller like overlay window, over all other apps along with callback events

Overview

system_alert_window

Pub

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

Android

Demo

1. Clip of example app and 2. Working of button click in the background

      

Application Class

JAVA (Application.java)

  import android.os.Bundle;
  import in.jvapps.system_alert_window.SystemAlertWindowPlugin;
  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);
      }

  }

KOTLIN (Application.kt)

  import `in`.jvapps.system_alert_window.SystemAlertWindowPlugin
  import io.flutter.app.FlutterApplication
  import io.flutter.plugin.common.PluginRegistry
  import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback
  class Application : FlutterApplication(), PluginRegistrantCallback {
      override fun onCreate() {
          super.onCreate()
          SystemAlertWindowPlugin.setPluginRegistrant(this)
      }

     override fun registerWith(registry: PluginRegistry) {
        SystemAlertWindowPlugin.registerWith(registry.registrarFor("in.jvapps.system_alert_window"));
     }
  }

Manifest

">
  //Permissions
  
   
  
   
  
   


      
   

   

Android 10 & below, Android GO (API 27)

Uses 'draw on top' permission and displays it as a overlay window

Android 11 & above

User has to allow 'All conversations can bubble' in the notification settings of the app. Uses Android Bubble APIs to show the overlay window inside a notification bubble.

Android GO (API 29)

User has to manually enable bubbles from the developer options. Uses Android Bubble APIs to show the overlay window inside a notification bubble.

IOS

Displays as a notification in the notification center [Help Needed]

Example

Request overlay permission

  await SystemAlertWindow.requestPermissions;

Show the overlay

  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);
        );
        
  SystemWindowFooter footer = SystemWindowFooter(
      buttons: [
        SystemWindowButton(
          text: SystemWindowText(text: "Simple button", fontSize: 12, textColor: Color.fromRGBO(250, 139, 97, 1)),
          tag: "simple_button", //useful to identify button click event
          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),
         ),
        SystemWindowButton(
          text: SystemWindowText(text: "Focus button", fontSize: 12, textColor: Colors.white),
          tag: "focus_button",
          width: 0,
          padding: SystemWindowPadding(left: 10, right: 10, bottom: 10, top: 10),
          height: SystemWindowButton.WRAP_CONTENT,
          decoration: SystemWindowDecoration(
          startColor: Color.fromRGBO(250, 139, 97, 1), endColor: Color.fromRGBO(247, 28, 88, 1), borderWidth: 0, borderRadius: 30.0),
         )
      ],
      padding: SystemWindowPadding(left: 16, right: 16, bottom: 12),
      decoration: SystemWindowDecoration(startColor: Colors.white),
      buttonsPosition: ButtonPosition.CENTER);
      
  SystemWindowBody body = SystemWindowBody(
          rows: [
            EachRow(
              columns: [
                EachColumn(
                  text: SystemWindowText(text: "Some body", fontSize: 12, textColor: Colors.black45),
                ),
              ],
              gravity: ContentGravity.CENTER,
            ),
          ],
          padding: SystemWindowPadding(left: 16, right: 16, bottom: 12, top: 12),
        );

  SystemAlertWindow.showSystemWindow(
      height: 230,
      header: header,
      body: body,
      footer: footer,
      margin: SystemWindowMargin(left: 8, right: 8, top: 100, bottom: 0),
      gravity: SystemWindowGravity.TOP,
      notificationTitle: "Incoming Call",
      notificationBody: "+1 646 980 4741",
      prefMode: SystemWindowPrefMode.DEFAULT);
      //Using SystemWindowPrefMode.DEFAULT uses Overlay window till Android 10 and bubble in Android 11
      //Using SystemWindowPrefMode.OVERLAY forces overlay window instead of bubble in Android 11.
      //Using SystemWindowPrefMode.BUBBLE forces Bubble instead of overlay window in Android 10 & above

Register for onClick events (button click)

  SystemAlertWindow.registerOnClickListener(callBackFunction);

  ///
  /// As this callback function is called from background, it should be declared on the parent level
  /// Whenever a button is clicked, this method will be invoked with a tag (As tag is unique for every button, it helps in identifying the button).
  /// You can check for the tag value and perform the relevant action for the button click
  ///
  void callBackFunction(String tag) {
    switch(tag){
      case "simple_button":
        print("Simple button has been clicked");
        break;
      case "focus_button":
        print("Focus button has been clicked");
        break;
      case "personal_btn":
        print("Personal button has been clicked");
        break;
      default:
        print("OnClick event of $tag");
    }
  }

Close the overlay

  SystemAlertWindow.closeSystemWindow();

Isolate communication

Use this snippet, if you want the callbacks on your main thread, instead of handling them in an isolate (like mentioned above)
Create an isolate_manager.dart
import 'dart:isolate';

import 'dart:ui';

class IsolateManager{

  static const FOREGROUND_PORT_NAME = "foreground_port";

  static SendPort lookupPortByName() {
    return IsolateNameServer.lookupPortByName(FOREGROUND_PORT_NAME);
  }

  static bool registerPortWithName(SendPort port) {
    assert(port != null, "'port' cannot be null.");
    removePortNameMapping(FOREGROUND_PORT_NAME);
    return IsolateNameServer.registerPortWithName(port, FOREGROUND_PORT_NAME);
  }

  static bool removePortNameMapping(String name) {
    assert(name != null, "'name' cannot be null.");
    return IsolateNameServer.removePortNameMapping(name);
  }

}
While initializing system alert window in your code
    await SystemAlertWindow.checkPermissions;
    ReceivePort _port = ReceivePort();
    IsolateManager.registerPortWithName(_port.sendPort);
    _port.listen((dynamic callBackData) {
      String tag= callBackData[0];
      switch (tag) {
        case "personal_btn":
          print("Personal button click : Do what ever you want here. This is inside your application scope");
          break;
        case "simple_button":
          print("Simple button click : Do what ever you want here. This is inside your application scope");
          break;
        case "focus_button":
          print("Focus button click : Do what ever you want here. This is inside your application scope");
          break;
      }
    });
    SystemAlertWindow.registerOnClickListener(callBackFunction);
Now the callBackFunction should looks like
bool callBackFunction(String tag) {
  print("Got tag " + tag);
  SendPort port = IsolateManager.lookupPortByName();
  port.send([tag]);
  return true;
}
Comments
  • registerOnClickListener not working

    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
    opened by ghost 14
  • Error when calling registerOnClickListener

    Error when calling registerOnClickListener

    I've tried multiple versions of flutter, but always get this error when calling SystemAlertWindow.registerOnClickListener(callBackFunction);:

    E/flutter (22530): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: type '(MethodCall) => Null' is not a subtype of type '((MethodCall) => Future<dynamic>)?' in type cast
    E/flutter (22530): #0      SystemAlertWindow.registerOnClickListener (package:system_alert_window/system_alert_window.dart:67:7)
    

    I've been using SystemAlertWindow 0.50, and i've tried with flutter 2.2.1 and 1.22.6. Any suggestions?

    opened by ihurrahi 11
  • SystemAlertWindow.closeSystemWindow(); is not working from Alart window

    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):

    opened by imSaharukh 11
  • Button callback is not invoked

    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.

    closed as no reply 
    opened by zaksnet 11
  • closeSystemWindow is not working properly

    closeSystemWindow is not working properly

    After calling showSystemWindow in android 11, with prefMode=SystemWindowPrefMode.OVERLAY, it displays correctly the expected screen, but after clicking a button to close the screen and calling closeSystemWindow, the window doesn't close. And I'm getting this message from the console: [ ] I/SystemAlertWindowPlugin( 6688): Invoke call back success, so it's supposed to be working fine, but it doesn't.

    This system window even remains in front of my screen and I can't get rid of it, it's displaying always and I have to restart my phone in order for it to dissapear.

    I'm using version 0.4.3 of SystemAlertWindow and android 11. I'm not testing it in iOS because this app is only for android.

    This is the code I'm using to show the alert window:

    return await SystemAlertWindow.showSystemWindow( header: SystemWindowHeader(...), body: SystemWindowBody(...), footer: SystemWindowFooter(...), width: 400, prefMode: SystemWindowPrefMode.OVERLAY, margin: SystemWindowMargin(left: 0, right: 0, top: 0, bottom: 0), gravity: SystemWindowGravity.CENTER);

    And this is the code I'm using to try to close the alert window: SystemAlertWindow.closeSystemWindow();

    opened by josefrvaldes 9
  • How can I close the window with a button in the window?

    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.

    closed as no reply 
    opened by duck-dev-go 9
  • Callback function is not called at all with no error

    Callback function is not called at all with no error

    After messing around

    I got the window to show - but now any button pressed is not calling the callbackfunction

    In console all what I get is this

    I/FLTFireMsgService( 3830): FlutterFirebaseMessagingBackgroundService started!
    W/FLTFireMsgService( 3830): Attempted to start a duplicate background isolate. Returning...
    
    D/SystemAlertWindowPlugin( 3830): onClickCallBackHandle 3292043634672398676
    D/FLTFireMsgReceiver( 3830): broadcast received for message
    D/SystemAlertWindowPlugin( 3830): Going to show System Alert Window
    I/WindowServiceNew( 3830): Closing the overlay window
    V/SystemAlertWindowPlugin( 3830): invoking callback for tag answer_button
    V/SystemAlertWindowPlugin( 3830): Invoking on method channel
    V/SystemAlertWindowPlugin( 3830): invoking callback for tag decline_button
    V/SystemAlertWindowPlugin( 3830): Invoking on method channel
    

    When i click the button i get the log of invoking callback and invoking on method as shown above

    But I inserted print function before the case in the call back and even this is not giving any thing

    void callBackFunction(String tag) {
      print('TAG RECORDER IS : $tag');
      switch (tag) {
        case "decline_button":
          print("Simple button has been clicked");
          break;
        case "focus_button":
          print("Focus button has been clicked");
          break;
        case "personal_btn":
          SystemAlertWindow.closeSystemWindow();
    
          break;
        default:
          print("OnClick event of $tag");
      }
    }
    
    opened by Mr-Slimon 7
  • button call back is not working for me

    button call back is not working for me

    Describe the bug after adding dependency in pubspec.yaml , when i hit run example app is running and the system alert is shown . but the button call back is not working for some reason !

    To Reproduce running in flutter for android app

    Errror msgs; E/flutter (28051): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: type '(MethodCall) => Null' is not a subtype of type '((MethodCall) => Future)?' in type cast E/flutter (28051): #0 SystemAlertWindow.registerOnClickListener (package:system_alert_window/system_alert_window.dart:67:7) E/flutter (28051): #1 _MyAppState.initState (package:untitled3/main.dart:46:23) E/flutter (28051): #2 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4805:57) E/flutter (28051): #3 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4638:5) E/flutter (28051): #4 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3673:14) E/flutter (28051): #5 Element.updateChild (package:flutter/src/widgets/framework.dart:3425:18) E/flutter (28051): #6 RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:1198:16) E/flutter (28051): #7 RenderObjectToWidgetElement.mount (package:flutter/src/widgets/binding.dart:1167:5) E/flutter (28051): #8 RenderObjectToWidgetAdapter.attachToRenderTree. (package:flutter/src/widgets/binding.dart:1112:18) E/flutter (28051): #9 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2573:19) E/flutter (28051): #10 RenderObjectToWidgetAdapter.attachToRenderTree (package:flutter/src/widgets/binding.dart:1111:13) E/flutter (28051): #11 WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:944:7) E/flutter (28051): #12 WidgetsBinding.scheduleAttachRootWidget. (package:flutter/src/widgets/binding.dart:924:7) E/flutter (28051): #13 _rootRun (dart:async/zone.dart:1420:47) E/flutter (28051): #14 _CustomZone.run (dart:async/zone.dart:1328:19) E/flutter (28051): #15 _CustomZone.runGuarded (dart:async/zone.dart:1236:7) E/flutter (28051): #16 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:1276:23) E/flutter (28051): #17 _rootRun (dart:async/zone.dart:1428:13) E/flutter (28051): #18 _CustomZone.run (dart:async/zone.dart:1328:19) E/flutter (28051): #19 _CustomZone.bindCallback. (dart:async/zone.dart:1260:23) E/flutter (28051): #20 Timer._createTimer. (dart:async-patch/timer_patch.dart:18:15) E/flutter (28051): #21 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:395:19) E/flutter (28051): #22 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:426:5) E/flutter (28051): #23 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12) E/flutter (28051): D/ViewRootImpl@c9f6bbc: ViewPostIme pointer 0 D/ViewRootImpl@c9f6bbc: ViewPostIme pointer 1 D/SystemAlertWindowPlugin(28051): onClickCallBackHandle -1 V/SystemAlertWindowPlugin(28051): invoking callback for tag simple_button E/SystemAlertWindowPlugin(28051): invokeCallBack failed, as codeCallBackHandle is null

    Expected behavior A clear and concise description of what you expected to happen.

    Screenshots here is my pubspec.yaml file SS image

    Versions (please complete the following information):

    • SystemAlertWindow: [eg. 0.2.1]
    • Device: [e.g. android os 7 ,9,10]

    Additional context hoping for the best

    opened by Sanjaycsan 6
  • How can I send a message from the callback to the app?

    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?
        }
      }
    
    opened by duck-dev-go 6
  • Android 12 not working

    Android 12 not working

    Overlay not showing in android 12

    No overlay shown in A12 currently.

    Error Log 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. E/MethodChannel#in.jvapps.system_alert_window(27257): at android.app.PendingIntent.checkFlags(PendingIntent.java:375) E/MethodChannel#in.jvapps.system_alert_window(27257): at android.app.PendingIntent.getActivityAsUser(PendingIntent.java:458) E/MethodChannel#in.jvapps.system_alert_window(27257): at android.app.PendingIntent.getActivity(PendingIntent.java:444) E/MethodChannel#in.jvapps.system_alert_window(27257): at android.app.PendingIntent.getActivity(PendingIntent.java:408) E/MethodChannel#in.jvapps.system_alert_window(27257): at in.jvapps.system_alert_window.utils.NotificationHelper.showNotification(NotificationHelper.java:136)

    Version android 12

    opened by sunny5497 5
  • FloatingActionButton

    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.

    waiting for reply closed as no reply 
    opened by imeDevelopers 4
  • can we overlay icon of the app on other apps .

    can we overlay icon of the app on other apps .

    am developing an app in flutter . that require google navigation , when my app redirects to google map I have to show my app icon on top of the map . when user clicks on app icon it should redirect my app again

    opened by exarcplus 1
  • Allow footer buttons to be arranged in a column

    Allow footer buttons to be arranged in a column

    At the moment, when you stack footer buttons, they are arranged in a row. Also, there is no way of appending buttons to the System Alert Window.

    It would be great if we could arrange the footer buttons in a column. Alternatively, you could include the buttons in the body element of the system alert window and allow us to arrange them in a column or row.

    enhancement 
    opened by TylerMutai 0
Owner
Venkata Sai Vamsi Penupothu
Venkata Sai Vamsi Penupothu
Codeflow 19 Sep 29, 2022
This package will help you to manage the overlays in your projects. Show a dialog, notification, window, or a panel easily

This package will help you to manage the overlays in your projects. Show a dialog, notification, window, or a panel easily. or use one of the helping widgets like AutoComplete, Expander(Dropdown).

Schaban Bochi 25 Dec 4, 2022
Performance overlay for Flutter apps that works on web.

performance Performance overlay for Flutter apps that works on web. Repo structure This repo currently contains the following packages: Package Conten

null 25 Dec 3, 2022
CoVAC is an all-in-one Covid info toolkit app, providing users the facility to check for available slots along with receiving the latest updates related to the pandemic and the virus.

CoVAC - Covid 19 Vaccine Availability Checker Introduction ?? CoVAC is an android application developed to provide users the facility to check the ava

Aryan Kenchappagol 6 Dec 29, 2021
Practice building basic animations in apps along with managing app state by BLoC State Management, Flutter Slider.

Practice building basic animations in apps along with managing app state by BLoC State Management including: Cubit & Animation Widget, Flutter Slider.

TAD 1 Jun 8, 2022
A Flutter widget that shoots confetti all over the screen.

Blast some confetti all over the screen and celebrate user achievements! Demo Video showing the Confetti in Action: https://youtu.be/dGMVyUY4-6M Live

Gordon Hayes 327 Jan 4, 2023
Overlay/OverlayEntry, but better

Call for maintainer I (@rrousselGit) am sadly unable to maintain flutter_portal at the moment due to a lack of time, and would like to find a new main

Remi Rousselet 401 Jan 2, 2023
Tinder-like class that allows dogs to pair with other dogs as play buddies and have fun(:

Paw-Tindr Tinder-like class that allows dogs to pair with other dogs as play buddies and have fun(: Setting Up Firebase Follow steps mentioned (here)[

null 3 Dec 15, 2022
Flutter Plugin for Facebook App Events

facebook_app_events Flutter plugin for Facebook App Events. An app event is an action that takes place in your app or on your web page such as a perso

oddbit 93 Jan 3, 2023
A flutter plugin to get facebook deep links and log app events using the latest Facebook SDK to include support for iOS 14

Facebook Sdk For Flutter LinkedIn GitHub facebook_sdk_flutter allows you to fetch deep links, deferred deep links and log facebook app events. This wa

Saad Farhan 23 Dec 17, 2022
A new flutter plugin with native wrappers that attempts to prove data transfer over sound by means of Frequency modulation

A new flutter plugin with native wrappers that attempts to prove data transfer over sound by means of Frequency modulation

Chiziaruhoma Ogbonda 36 Aug 31, 2022
Show a draggable floating chat icon button and show messages on screens

Show a draggable floating chat icon button and show messages on screens Features A widget for displaying a chat icon (or custom widget) on top of a ba

CU Apps 4 May 5, 2022
Download files from Firebase Storage with Flutter. List all images, videos, or other files from Firebase and download them.

Flutter Tutorial - Download Files From Firebase Storage Download files from Firebase Storage with Flutter. List all images, videos, or other files fro

Johannes Milke 28 Dec 4, 2022
Push Notification service for anime episodes and news. The episode updates will be based on actual upload on the internet and NOT Japan tv schedule as other apps do.

Quantz Push Notification service for anime episodes and news. Features Sub and dub - get notified with latest anime episodes on the internet. Ongoing

null 18 Nov 21, 2022
Flutter boilerplate: support Android, iOS, Web, Mac, Linux, Window with bloc(cubit) state management

Flutter boilerplate: support Android, iOS, Web, Mac, Linux, Window with bloc(cubit) state management, dynamic theme, localization, environment (.env), logger, navigation (go_router), responsiveness (mobile, tablet, desktop), lint, unit/widget/integration test and more ...

Bumbii Co., Ltd 34 Dec 29, 2022
Flutter boilerplate: support Android, iOS, Web, Mac, Linux, Window with bloc(cubit)

Flutter boilerplate: support Android, iOS, Web, Mac, Linux, Window with bloc(cubit) state management, dynamic theme, localization, environment (.env), logger, navigation (go_router), responsiveness (mobile, tablet, desktop), lint, and unit/integration test.

Bumbii Co., Ltd 34 Dec 29, 2022
Sample Flutter Drawing App which allows the user to draw onto the canvas along with color picker and brush thickness slider.

DrawApp Sample Flutter Drawing App which allows the user to draw onto the canvas along with color picker and brush thickness slider. All code free to

Jake Gough 226 Nov 3, 2022
COVID-19 application made with Flutter, following Test Driven Development (TDD) and Clean Architecture along with Internationalization with JSON.

Covid App COVID-19 application made with Flutter, following Test Driven Development (TDD) and Clean Architecture along with Internationalization with

Sandip Pramanik 4 Aug 4, 2022
Following Along with a tutorial and adding differing customization to learn Dart and Flutter

flutter_ss_portfolio A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you sta

Midnight 0 Nov 28, 2021