FlutterBadgeControllerPlatform class abstract

The platform interface for the flutter_badge_controller plugin.

This defines the contract that all platform implementations (Android, iOS, Web, etc.) must follow in order to support app icon badges.

By default, MethodChannelFlutterBadgeController is used, which communicates with the native platform via a MethodChannel.

Platform-specific implementations should extend FlutterBadgeControllerPlatform and set FlutterBadgeControllerPlatform.instance to their own class during registration.

Example:

// Set a custom implementation (e.g., web)
FlutterBadgeControllerPlatform.instance = MyWebFlutterBadgeController();
Inheritance
  • Object
  • PlatformInterface
  • FlutterBadgeControllerPlatform
Implementers

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clearBadge() Future<void>
Clears the app icon badge (sets it back to 0).
getBadgeCount() Future<int?>
Returns the current badge count.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setBadgeCount(int count) Future<void>
Sets the app icon badge count to count.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

instance FlutterBadgeControllerPlatform
The default instance of FlutterBadgeControllerPlatform to use.
getter/setter pair