Notification class abstract
The Notification interface of the Notifications API is used to configure and display desktop notifications to the user.
- Annotations
-
- @anonymous
- @JS()
Constructors
Properties
- actions → List
-
The actions array of the notification as specified in the options
parameter of the constructor.
no setter
- badge → String
-
The URL of the image used to represent the notification when there is not
enough space to display the notification itself.
no setter
- body → String
-
The body string of the notification as specified in the options parameter
of the constructor.
no setter
- data → dynamic
-
Returns a structured clone of the notification’s data.
no setter
- dir → String
-
The text direction of the notification as specified in the options
parameter of the constructor.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → String
-
The URL of the image used as an icon of the notification as specified in
the options parameter of the constructor.
no setter
- image → String
-
The URL of an image to be displayed as part of the notification, as
specified in the options parameter of the constructor.
no setter
- lang → String
-
The language code of the notification as specified in the options
parameter of the constructor.
no setter
- requireInteraction → bool
-
A Boolean indicating that a notification should remain active until the
user clicks or dismisses it, rather than closing automatically.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- silent → bool
-
Specifies whether the notification should be silent, i.e. no sounds or
vibrations should be issued, regardless of the device settings.
no setter
- tag → String
-
The ID of the notification (if any) as specified in the options parameter
of the constructor.
no setter
- timestamp → DateTime
-
Specifies the time at which a notification is created or applicable
(past, present, or future).
no setter
- title → String
-
The title of the notification as specified in the first parameter of the
constructor.
no setter
-
vibrate
→ List<
int> -
Specifies a vibration pattern for devices with vibration hardware to emit.
A vibration pattern can be an array with as few as one member. The values
are times in milliseconds where the even indices (0, 2, 4, etc.) indicate
how long to vibrate and the odd indices indicate how long to pause. For
example
300, 100, 400
would vibrate 300ms, pause 100ms, then vibrate 400ms.no setter
Methods
-
close(
) → void - Close a previously displayed notification.
-
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
- permission → String
-
A string representing the current permission to display notifications.
Possible value are: denied (the user refuses to have notifications
displayed), granted (the user accepts having notifications displayed), or
default (the user choice is unknown and therefore the browser will act as
if the value were denied).
no setter