create method

Future<String> create(
  1. String? notificationId,
  2. NotificationOptions options
)

Creates and displays a notification. |notificationId|: Identifier of the notification. If not set or empty, an ID will automatically be generated. If it matches an existing notification, this method first clears that notification before proceeding with the create operation. The identifier may not be longer than 500 characters.

The notificationId parameter is required before Chrome 42. |options|: Contents of the notification. |callback|: Returns the notification id (either supplied or generated) that represents the created notification.

The callback is required before Chrome 42.

Implementation

Future<String> create(
  String? notificationId,
  NotificationOptions options,
) async {
  var $res = await promiseToFuture<String>($js.chrome.notifications.create(
    notificationId,
    options.toJS,
  ));
  return $res;
}