NotificationContent class

Represents the content of a notification with customizable options. If notification has no body or title, it will only be created, but not displayed to the user (background notification).

Inheritance

Constructors

NotificationContent({required int id, required String channelKey, String? title, String? body, String? titleLocKey, String? bodyLocKey, List<String>? titleLocArgs, List<String>? bodyLocArgs, String? groupKey, String? summary, String? icon, String? largeIcon, String? bigPicture, String? customSound, bool showWhen = true, bool wakeUpScreen = false, bool fullScreenIntent = false, bool roundedLargeIcon = false, bool roundedBigPicture = false, bool autoDismissible = true, Color? color, Duration? timeoutAfter, Duration? chronometer, Color? backgroundColor, ActionType actionType = ActionType.Default, NotificationLayout notificationLayout = NotificationLayout.Default, Map<String, String?>? payload, NotificationCategory? category, bool hideLargeIconOnExpand = false, bool locked = false, double? progress, int? badge, String? ticker, bool displayOnForeground = true, bool displayOnBackground = true, Duration? duration, NotificationPlayState? playState, double? playbackSpeed})
Constructs a NotificationContent object with various customization options.

Properties

actionType ↔ ActionType?
Returns the action type of the notification.
getter/setter pairinherited
autoCancel → bool?
no setterinherited
autoDismissable → bool?
no setterinherited
autoDismissible → bool?
Returns whether the notification is auto-dismissible.
no setterinherited
backgroundColor → Color?
Returns the background color of the notification.
no setterinherited
badge → int?
Returns the badge number for the notification.
no setter
bigPicture → String?
Returns the big picture of the notification.
no setterinherited
bigPictureImage → ImageProvider<Object>?
no setterinherited
bigPicturePath → String?
no setterinherited
body → String?
Returns the body text of the notification.
no setterinherited
bodyLockArgs → List<String>?
Returns the args used to translate the notification body.
no setterinherited
bodyLockKey → String?
Returns the body key used to translate the notification.
no setterinherited
bodyWithoutHtml → String?
no setterinherited
category → NotificationCategory?
Returns the category of the notification.
no setterinherited
channelKey → String?
Returns the channel key of the notification.
no setterinherited
chronometer → Duration?
Returns the chronometer duration for the notification.
no setterinherited
color → Color?
Returns the color of the notification.
no setterinherited
createdDate ↔ DateTime?
getter/setter pairinherited
createdLifeCycle ↔ NotificationLifeCycle?
getter/setter pairinherited
createdSource ↔ NotificationSource?
getter/setter pairinherited
customSound → String?
Returns the custom sound of the notification.
no setterinherited
displayedDate ↔ DateTime?
Returns the date and time when the notification was displayed.
getter/setter pairinherited
displayedLifeCycle ↔ NotificationLifeCycle?
getter/setter pairinherited
displayOnBackground → bool?
Indicates whether the notification is displayed when the app is in the background.
no setter
displayOnForeground → bool?
Indicates whether the notification is displayed when the app is in the foreground.
no setter
duration → Duration?
Returns the play media duration (media player).
no setter
fullScreenIntent → bool?
Returns whether the notification should use a full screen intent.
no setterinherited
groupKey → String?
Returns the group key of the notification.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
hideLargeIconOnExpand → bool?
Returns whether to hide the large icon when the notification is expanded.
no setter
icon → String?
Returns the icon of the notification.
no setterinherited
id → int?
Returns the id of the notification.
no setterinherited
largeIcon → String?
Returns the large icon of the notification.
no setterinherited
largeIconImage → ImageProvider<Object>?
no setterinherited
largeIconPath → String?
no setterinherited
locked → bool?
Indicates whether the notification is locked.
no setter
notificationLayout → NotificationLayout?
Returns the layout type of the notification.
no setter
payload → Map<String, String?>?
Returns the custom payload of the notification.
no setterinherited
playbackSpeed → double?
Returns the playback speed for notification (media player).
no setter
playState → NotificationPlayState?
Returns the play state of the notification (media player).
no setter
privacy ↔ NotificationPrivacy?
Returns the privacy setting of the notification.
getter/setter pairinherited
progress → double?
Returns the progress value of the notification, if set.
no setter
roundedBigPicture → bool?
Returns whether the big picture should be rounded.
no setterinherited
roundedLargeIcon → bool?
Returns whether the large icon should be rounded.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
showWhen → bool?
Returns whether the notification should show a timestamp.
no setterinherited
summary → String?
Returns the summary of the notification.
no setterinherited
ticker → String?
Returns the ticker text of the notification.
no setter
timeoutAfter → Duration?
Returns the duration after which the notification should be timed out.
no setterinherited
title → String?
Returns the title of the notification.
no setterinherited
titleLockArgs → List<String>?
Returns the args used to translate the notification title.
no setterinherited
titleLockKey → String?
Returns the title key used to translate the notification.
no setterinherited
titleWithoutHtml → String?
no setterinherited
wakeUpScreen → bool?
Returns whether the notification should wake up the screen.
no setterinherited

Methods

fromMap(Map<String, dynamic> mapData) → NotificationContent?
Creates a NotificationContent instance from a map of data.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
processRetroCompatibility(Map<String, dynamic> dataMap) → Map<String, dynamic>
inherited
toMap() → Map<String, dynamic>
Converts the NotificationContent instance to a map.
toString() → String
Returns a string representation of the NotificationContent instance.
override
validate() → void
Validates
inherited

Operators

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