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. |Returns|: Returns a Promise which resolves with the notification id (either supplied or generated) that represents the created notification.

Implementation

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