flutter_native_badge
2.1.0, released 4 weeks ago by an unverified publisher
Flutter plugin to set, clear, and query app icon badge counts on iOS, macOS, and Android.
What it does
Provides a Dart API to display numeric badges or a red dot on the app icon, clear the badge, and request the required notification permissions. It abstracts the native badge implementations for iOS, macOS, and Android launchers.
AI-written summary of version 2.1.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need a native app‑icon badge on iOS, macOS, or Android without writing platform code
- You want a simple, synchronous check for badge support and a unified API across platforms
Skip it when
- Your app runs only on web or desktop platforms that don’t show app‑icon badges
- You need custom in‑app notification UI or full notification handling beyond a badge
Strengths
- Cross‑platform (iOS, macOS, Android) support
- Handles Android launcher differences automatically
- Simple, imperative API with no code generation
Weaknesses
- Android implementation uses a silent notification that may appear in the shade
- getBadgeCount is deprecated on iOS and returns only the last set value on Android
- No web support
Setup
- Kind
- Plugin (native code)
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 3
Add POST_NOTIFICATIONS permission to AndroidManifest for API 33+, call requestPermission() on iOS/macOS as needed; optional Swift Package Manager or CocoaPods for iOS/macOS integration
import 'package:flutter_native_badge/flutter_native_badge.dart';
if (FlutterNativeBadge.isSupported) {
await FlutterNativeBadge.requestPermission();
await FlutterNativeBadge.setBadgeCount(5);
await FlutterNativeBadge.clearBadgeCount();
}Alternatives
Packages that do the same job and could replace flutter_native_badge.
- flutter_local_notifications_linux
Linux implementation of the flutter_local_notifications plugin.
81Compare - firebase_in_app_messaging
Flutter plugin for Firebase In-App Messaging campaigns.
93Compare - flutter_notification_channel
Plugin for registering and configuring Android notification channels.
55Compare - eraser
A flutter plugin that allows remote push notifications to be dismissed and the iOS badge count to be reset.
75Compare