createNotification method

  1. @override
Future<bool> createNotification({
  1. required NotificationContent content,
  2. NotificationSchedule? schedule,
  3. List<NotificationActionButton>? actionButtons,
  4. Map<String, NotificationLocalization>? localizations,
})
override

LOCAL NOTIFICATION METHODS ********************************************* Creates a new notification with the specified content.

The content parameter is a NotificationContent object that represents the content of the notification, including the title, body, icon, and other details.

The optional schedule parameter is a NotificationSchedule object that specifies when the notification should be delivered.

The optional actionButtons parameter is a list of NotificationActionButton objects that represent the action buttons to be displayed on the notification.

The optional localizations parameter is a Map of NotificationLocalization objects that represent the localized content of the notification, such as the title and body text in different languages.

This method returns a Future that resolves to true if the notification was successfully created, or false if an error occurred.

If the notification has no body or title, it will be created but not displayed (i.e. it will be a "background" notification).

This method is typically used to create a new notification with the specified content and delivery schedule. If an action button or buttons are provided, they will be displayed on the notification to allow the user to take specific actions in response to the notification.

The localizations parameter can be used to provide localized versions of the notification content, such as the title and body text in different languages. To provide localized content, create a NotificationLocalization object for each language, and include them in a Map that maps the language codes as keys (e.g. "en", "pt-br", "es", etc.) to their corresponding localizations. When the notification is displayed, the appropriate localization will be selected based on the user's language preferences or the default system language.

Implementation

@override
Future<bool> createNotification({
  required NotificationContent content,
  NotificationSchedule? schedule,
  List<NotificationActionButton>? actionButtons,
  Map<String, NotificationLocalization>? localizations,
}) {
  return AwesomeNotificationsPlatform.instance.createNotification(
      content: content,
      schedule: schedule,
      actionButtons: actionButtons,
      localizations: localizations);
}