NotificationMessage.fromPluginTemplate constructor

NotificationMessage.fromPluginTemplate(
  1. String id,
  2. String title,
  3. String body, {
  4. String? image,
  5. Map<String, dynamic> payload = const {},
  6. String? launch,
  7. String? largeImage,
  8. String? group,
})

crete NotificationMessage object when you want to send notificaation with plugin template

Implementation

NotificationMessage.fromPluginTemplate(
  /// Gets or sets the unique identifier of this notification within the notification Group.
  this.id,
  String this.title,
  String this.body, {
  /// Thumbnail next to notification text
  this.image,
  this.payload = const {},

  /// A string that is passed to the application when it is activated by the toast. The format and contents of this string are defined by the app for its own use. When the user taps or clicks the toast to launch its associated app, the launch string provides the context to the app that allows it to show the user a view relevant to the toast content, rather than launching in its default way.
  this.launch,

  /// Large image at the bottom of the notification text
  this.largeImage,

  /// Gets or sets the group identifier for the notification.
  this.group,
}) : temolateType = TemplateType.plugin {
  assert(id.trim().isNotEmpty, "id must not be empty string");
  assert(group == null || group!.trim().isNotEmpty,
      "group must not be empty string");
}