Notification class

Represents how a persistent notification is to be presented to the user using the NotificationManager.

The NotificationBuilder has been added to make it easier to construct notifications.

See: https://developer.android.com/reference/android/app/Notification

Implemented types

Constructors

Notification({List<NotificationAction> actions, String category, Color color, Bundle extras, int flags, int iconLevel, int number, Notification publicVersion, int visibility, int when })
Constructs a Notification object.

Properties

actions List<NotificationAction>
Array of all NotificationAction structures attached to this notification. [...]
final
category String
One of the predefined notification categories. [...]
final
color Color
Accent color (an ARGB integer) to be applied. [...]
final
extras Bundle
Additional semantic data to be carried around. [...]
final
flags int
Any additional flags. [...]
final
iconLevel int
If the icon in the status bar is to have more than one level, you can set this. [...]
final
number int
The number of events that this notification represents. [...]
final
publicVersion Notification
Replacement version of this notification whose content will be shown in an insecure context such as atop a secure keyguard. [...]
final
visibility int
The sphere of visibility of this notification. [...]
final
when int
A timestamp related to this notification, in milliseconds since the epoch. [...]
final
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

getBadgeIconType() int
Returns what icon should be shown for this notification if it is being displayed in a Launcher that supports badging. [...]
getChannelId() String
Returns the id of the channel this notification posts to. [...]
getGroup() String
Get the key used to group this notification into a cluster or stack with other notifications on devices which support such rendering. [...]
getGroupAlertBehavior() int
Returns which type of notifications in a group are responsible for audibly alerting the user. [...]
getLargeIcon() Icon
The large icon shown in this notification's content view. [...]
getSettingsText() String
Returns the settings text. [...]
getShortcutId() String
Returns the id that this notification supersedes, if any. [...]
getSmallIcon() Icon
The small icon representing this notification in the status bar and content view. [...]
getSortKey() String
Get a sort key that orders this notification among other notifications from the same package. [...]
getTimeoutAfter() int
Returns the duration from posting after which this notification should be canceled by the system, if it's not canceled already. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited

Constants

BADGE_ICON_LARGE → const int
See: https://developer.android.com/reference/android/app/Notification#BADGE_ICON_LARGE
2
BADGE_ICON_NONE → const int
See: https://developer.android.com/reference/android/app/Notification#BADGE_ICON_NONE
0
BADGE_ICON_SMALL → const int
See: https://developer.android.com/reference/android/app/Notification#BADGE_ICON_SMALL
1
VISIBILITY_PRIVATE → const int
See: https://developer.android.com/reference/android/app/Notification#VISIBILITY_PRIVATE
0
VISIBILITY_PUBLIC → const int
See: https://developer.android.com/reference/android/app/Notification#VISIBILITY_PUBLIC
1
VISIBILITY_SECRET → const int
See: https://developer.android.com/reference/android/app/Notification#VISIBILITY_SECRET
-1