bubble_overlay 0.1.1+1

  • Readme
  • Changelog
  • Example
  • Installing
  • 75

Android only feature #

Getting Started #

What you need to include in your project to start working:

  • Open your AndroidManifest.xml and add inside application tag:

          android:exported="false" />

And add this permissions at manifest top level:

    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />

Create a local variable in your dart file:

    final BubbleOverlay bubbleOverlay = BubbleOverlay();

The first time you call openBubble(), it will request Android overlay permission

After granting permission, call it again, and it will open the bubble

More details you can find in example/lib/main.dart

How it works #

BubbleOverlayPlugin.kt: Make the 'talk' with Dart/Flutter with native Android OS, connect the OS with the Service, etc.

BubbleOverlayService.kt Updates Bubble data, all bubble data is parsed from XML file (layout_bubble.xml), as developing a native app for Android with XML

Google Play Demo #

Link: https://play.google.com/store/apps/details?id=com.adriankohls.bubble_overlay_example

Changelog #

0.1.1+1 #

  • Fixed 'No implementation found for method isBubbleOpen on channel com.adriankohls/bubble_overlay'

0.1.1 #

Fixed nullability crash on some devices due to memory/OS apps GC management Added missing resource releasers to avoid memory leak

0.1.0+1 #

Flutter format

0.1.0 #

Fixed isOpen behaviour by checking if Android Service class is running periodically (1 second) Added callback, and close with proper dispose to avoid memory leak

0.0.4+1 #

Fixed Readme

0.0.4 #

Added iOS project folder to make plugin runnable in Flutter project for Android and iOS. Remember, this plugin only works for Android platform

0.0.3 #

  • Fixed close button layout
  • Fixed bubble layouts
  • Renamed title to topText
  • Fixed bubble text sizes
  • Added Timer callback, for custom inside bubble functions
  • Fixed some access to object

0.0.2 #

  • Removed close bubble on tapping on bubble, close bubble overlay only tapping on X
  • Added top and bottom text to bubble
  • Fixed title, middle and bottom text size

0.0.1+0 #

  • Initial release

0.0.1+1 #

  • Initial release

0.0.1+2 #

  • Initial release

0.0.1+3 #

  • Initial release

0.0.1+4 #

  • Initial release

0.0.1+5 #

  • Initial release

0.0.1+6 #

  • Initial release


import 'dart:async';
import 'dart:developer';

import 'package:bubble_overlay/bubble_overlay.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;

Future<void> main() async {
  runApp(MaterialApp(home: Home()));

class Home extends StatefulWidget {
  _Home createState() => _Home();

class _Home extends State<Home> {
  final BubbleOverlay bubbleOverlay = BubbleOverlay();
  bool alternateColor = false;

  void setMiddleTextCounter() {
    int time = 0;
    if (bubbleOverlay.isOpen)
          .setCallback(Timer.periodic(Duration(milliseconds: 500), (timer) {
        if (bubbleOverlay.isOpen) bubbleOverlay.updateMiddleText('$time');

  void setBottomTextHelloWorld() {
    if (bubbleOverlay.isOpen) {
      bubbleOverlay.updateBottomText('Hello World');

  void closeBubble() {
    if (bubbleOverlay.isOpen) {

  void updateTextAndBgColor() {
    if (bubbleOverlay.isOpen) {
      String textColor = alternateColor ? '#000000' : '#ffffff';
      String bgColor = alternateColor ? '#ffffff' : '#000000';
      alternateColor = !alternateColor;

  void setTopText() {
    if (bubbleOverlay.isOpen) {
      bubbleOverlay.updateTopText('Set Bubble Title');

  void setTopIcon() async {
    String url =
    http.get(url).then((response) {
      if (response != null)

  void setBottomIcon() async {
    String url =
    http.get(url).then((response) {
      if (response != null)

  Widget build(BuildContext context) => Scaffold(
        appBar: AppBar(title: Text('Bubble Overlay')),
        body: SingleChildScrollView(
          padding: EdgeInsets.all(50),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.stretch,
            children: [
                  child: Text('Open Bubble Overlay'),
                  onPressed: () => bubbleOverlay.openBubble()),
                onPressed: closeBubble,
                child: Text('Close Bubble'),
                onPressed: setTopText,
                child: Text('Set Bubble Top Text'),
                onPressed: setMiddleTextCounter,
                child: Text('Set Middle Text Counter'),
                onPressed: setBottomTextHelloWorld,
                child: Text('Set Bottom Text "Hello World"'),
                onPressed: updateTextAndBgColor,
                child: Text('Update text and background color'),
                child: Text('Set Top Icon'),
                onPressed: setTopIcon,
                child: Text('Set Bottom Icon'),
                onPressed: setBottomIcon,

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  bubble_overlay: ^0.1.1+1

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:bubble_overlay/bubble_overlay.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jul 2, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform linux

Because of import path [package:bubble_overlay/bubble_overlay.dart] that declares support for platforms: android, ios

Package does not support Flutter platform macos

Because of import path [package:bubble_overlay/bubble_overlay.dart] that declares support for platforms: android, ios

Package does not support Flutter platform web

Because of import path [package:bubble_overlay/bubble_overlay.dart] that declares support for platforms: android, ios

Package does not support Flutter platform windows

Because of import path [package:bubble_overlay/bubble_overlay.dart] that declares support for platforms: android, ios

Package not compatible with SDK dart

because of import path [bubble_overlay] that is in a package requiring null.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies