BloomNotifications class

Cross-platform push and local notifications manager wrapping flutter_local_notifications.

Manages notification channels on Android, notification authorization permissions on iOS/Android, and foreground/background local alerts.

Example:

final notifications = BloomNotifications();
await notifications.initialize(
  channels: [
    const BloomNotificationChannel(id: 'reminders', name: 'Task Reminders'),
  ],
);

await notifications.show(
  title: 'Task Reminder',
  body: 'Review deployment checklist',
);

Constructors

BloomNotifications([FlutterLocalNotificationsPlugin? plugin])
Creates a BloomNotifications manager with an optional custom plugin instance for testing.

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

cancel(int id) Future<void>
Cancels an active or pending notification by id.
cancelAll() Future<void>
Cancels all active and scheduled notifications.
initialize({List<BloomNotificationChannel> channels = const [], String defaultAndroidIcon = '@mipmap/ic_launcher', bool requestPermissions = true, void onNotificationTap(NotificationResponse response)?}) Future<void>
Initializes notification subsystem, requests permissions if requestPermissions is true, and registers Android notification channels.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
requestPermissions() Future<bool>
Requests notification authorization from the user via BloomPermissions.
show({required String title, required String body, String? payload, String? channelId, String channelName = 'General', NotificationImportance importance = NotificationImportance.high, int? id}) Future<int>
Displays a local notification with title, body, and optional payload.
toString() String
A string representation of this object.
inherited

Operators

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