Notification extension type
The Notification
interface of the Notifications API
is used to
configure and display desktop notifications to the user.
These notifications' appearance and specific functionality vary across platforms but generally they provide a way to asynchronously provide information to the user.
API documentation sourced from MDN Web Docs.
- on
- Implemented types
- Available extensions
Constructors
- Notification(String title, [NotificationOptions options])
-
factory
Properties
- badge → String
-
The
badge
read-only property of the Notification interface returns a string containing the URL of an image to represent the notification when there is not enough space to display the notification itself such as for example, the Android Notification Bar. On Android devices, the badge should accommodate devices up to 4x resolution, about 96 by 96 px, and the image will be automatically masked.no setter - body → String
-
The
body
read-only property of the Notification interface indicates the body string of the notification, as specified in thebody
option of theNotification.Notification
constructor.no setter - data → JSAny?
-
The
data
read-only property of the Notification interface returns a structured clone of the notification's data, as specified in thedata
option of theNotification.Notification
constructor.no setter - dir → NotificationDirection
-
The
dir
read-only property of the Notification interface indicates the text direction of the notification, as specified in thedir
option of theNotification.Notification
constructor.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- icon → String
-
The
icon
read-only property of the Notification interface contains the URL of an icon to be displayed as part of the notification, as specified in theicon
option of theNotification.Notification
constructor.no setter - lang → String
-
The
lang
read-only property of the Notification interface indicates the language used in the notification, as specified in thelang
option of theNotification.Notification
constructor.no setter - onclick ↔ EventHandler?
-
getter/setter pair
- onclose ↔ EventHandler?
-
getter/setter pair
- onerror ↔ EventHandler?
-
getter/setter pair
- onshow ↔ EventHandler?
-
getter/setter pair
- requireInteraction → bool
-
The
requireInteraction
read-only property of the Notification interface returns a boolean value 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?
-
The
silent
read-only property of the Notification interface specifies whether the notification should be silent, i.e., no sounds or vibrations should be issued, regardless of the device settings. This is specified in thesilent
option of theNotification.Notification
constructor.no setter - tag → String
-
The
tag
read-only property of the Notification interface signifies an identifying tag for the notification, as specified in thetag
option of theNotification.Notification
constructor.no setter - title → String
-
The
title
read-only property of the Notification interface indicates the title of the notification, as specified in thetitle
parameter of theNotification.Notification
constructor.no setter
Methods
-
addEventListener(
String type, EventListener? callback, [JSAny options]) → void -
The
addEventListener()
method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.inherited -
close(
) → void -
The
close()
method of the Notification interface is used to close/remove a previously displayed notification. -
dispatchEvent(
Event event) → bool -
The
dispatchEvent()
method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually withdispatchEvent()
.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeEventListener(
String type, EventListener? callback, [JSAny options]) → void -
The
removeEventListener()
method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- permission → NotificationPermission
-
The
permission
read-only static property of the Notification interface indicates the current permission granted by the user for the current origin to display web notifications.no setter
Static Methods
-
requestPermission(
[NotificationPermissionCallback deprecatedCallback]) → JSPromise< JSString> -
The
requestPermission()
static method of the Notification interface requests permission from the user for the current origin to display notifications.