NotificationChannelManager class
Manages Android notification channels.
Notification channels (Android 8.0+) allow users to control notification behavior per category. This manager creates and manages predefined channels for common notification types.
Usage
final manager = NotificationChannelManager(flutterLocalNotificationsPlugin);
await manager.createDefaultChannels();
// Use a specific channel
await notificationService.showNotification(
payload,
channelId: NotificationChannelManager.channelHighPriority,
);
Default Channels
- High Priority: Urgent notifications (alerts, time-sensitive updates)
- Default: Standard notifications (messages, updates)
- Low Priority: Non-urgent notifications (promotions, tips)
- Silent: No sound or vibration (background updates)
Constructors
- NotificationChannelManager(FlutterLocalNotificationsPlugin _plugin)
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
-
createChannel(
AndroidNotificationChannel channel) → Future< void> - Creates a single notification channel.
-
createDefaultChannels(
) → Future< void> - Creates all default notification channels.
-
deleteChannel(
String channelId) → Future< void> - Deletes a notification channel.
-
getChannels(
) → Future< List< AndroidNotificationChannel> > - Gets all created notification channels.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
defaultChannels
→ List<
AndroidNotificationChannel> -
Gets the default channels list.
no setter
Constants
- channelDefault → const String
- Default channel ID for standard notifications.
- channelHighPriority → const String
- High priority channel ID for urgent, time-sensitive notifications.
- channelLowPriority → const String
- Low priority channel ID for non-urgent notifications.
- channelSilent → const String
- Silent channel ID for notifications with no sound or vibration.