flutter_app_badger 1.0.2

  • README.md
  • Example
  • Installing
  • Versions
  • 90

Flutter App Badger plugin #

This plugin for Flutter adds the ability to change the badge of the app in the launcher. It supports iOS and some Android devices (the official API does not support the feature, even on Oreo).

Android badge

Android badge

Getting Started #

iOS #

On iOS, the notification permission is required to update the badge. It is automatically asked when the badge is added or removed.

Please also add the following to your Info.plist:


Android #

On Android, no official API exists to show a badge in the launcher. But some devices (Samsung, HTC...) support the feature. Thanks to the Shortcut Badger library, ~ 16 launchers are supported.

Dart #

First, you just have to import the package in your dart files with:

import 'package:flutterappbadger/flutterappbadger.dart';

Then you can add a badge:


Remove a badge:


Or just check if the device supports this feature with:


[1.0.2] - 5th July 2018

  • Android: Include the PR #268 to support Oreo devices.

[1.0.1] - 10th April 2018

  • Fix a bug with the Android build.

[1.0.0] - 10th April 2018

  • Initial Release.


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

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

class MyApp extends StatefulWidget {
  _MyAppState createState() => new _MyAppState();

class _MyAppState extends State<MyApp> {
  String _appBadgeSupported = 'Unknown';

  initState() {

  initPlatformState() async {
    String appBadgeSupported;
    try {
      bool res = await FlutterAppBadger.isAppBadgeSupported();
      if (res) {
        appBadgeSupported = 'Supported';
      } else {
        appBadgeSupported = 'Not supported';
    } on PlatformException {
      appBadgeSupported = 'Failed to get badge support.';

    // 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(() {
      _appBadgeSupported = appBadgeSupported;

  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: new Text('Plugin example app'),
        body: new SizedBox.expand(
          child: new Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: <Widget>[
              new Text('Badge supported: $_appBadgeSupported\n'),
              new RaisedButton(
                child: new Text('Add badge'),
                onPressed: () {
              new RaisedButton(
                  child: new Text('Remove badge'),
                  onPressed: () {

  void _addBadge() {

  void _removeBadge() {

Use this package as a library

1. Depend on it

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

  flutter_app_badger: ^1.0.2

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:

import 'package:flutter_app_badger/flutter_app_badger.dart';
Version Uploaded Documentation Archive
1.0.2 Jul 5, 2018 Go to the documentation of flutter_app_badger 1.0.2 Download flutter_app_badger 1.0.2 archive
1.0.1 Apr 10, 2018 Go to the documentation of flutter_app_badger 1.0.1 Download flutter_app_badger 1.0.1 archive
1.0.0 Apr 10, 2018 Go to the documentation of flutter_app_badger 1.0.0 Download flutter_app_badger 1.0.0 archive
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 Apr 25, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.2.0
  • pana: 0.12.14
  • Flutter: 1.4.7


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-1 points)

6 out of 6 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.28.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8