NotificationPayload constructor

const NotificationPayload({
  1. required String id,
  2. required String title,
  3. required String body,
  4. Map<String, dynamic> data = const <String, dynamic>{},
  5. String? imageUrl,
  6. String? icon,
  7. String? sound,
  8. String? badge,
  9. String? tag,
  10. String? channelId,
  11. String? channelName,
  12. String? channelDescription,
  13. NotificationImportance importance = NotificationImportance.defaultImportance,
  14. NotificationPriority priority = NotificationPriority.defaultPriority,
  15. DateTime? timestamp,
  16. String? largeIcon,
  17. String? bigPicture,
  18. List<NotificationAction> actions = const <NotificationAction>[],
  19. String? color,
  20. List<int>? vibrationPattern,
  21. String? category,
  22. String? threadIdentifier,
  23. String? collapseKey,
  24. int? ttl,
  25. Duration? deliveryDelay,
  26. bool isScheduled = false,
  27. DateTime? scheduledDateTime,
  28. RepeatInterval? repeatInterval,
  29. String? payload,
  30. bool showTimestamp = true,
  31. bool ongoing = false,
  32. bool autoCancel = true,
  33. bool silent = false,
  34. NotificationPayload? publicVersion,
  35. String? ticker,
  36. int? whenTimestamp,
  37. bool usesChronometer = false,
  38. bool chronometerCountDown = false,
  39. bool enableLights = true,
  40. bool enableVibration = true,
  41. bool playSound = true,
  42. bool criticalAlert = false,
  43. InterruptionLevel interruptionLevel = InterruptionLevel.active,
})

The constructor of the notification payload.

Implementation

const NotificationPayload({
  required this.id,
  required this.title,
  required this.body,
  this.data = const <String, dynamic>{},
  this.imageUrl,
  this.icon,
  this.sound,
  this.badge,
  this.tag,
  this.channelId,
  this.channelName,
  this.channelDescription,
  this.importance = NotificationImportance.defaultImportance,
  this.priority = NotificationPriority.defaultPriority,
  this.timestamp,
  this.largeIcon,
  this.bigPicture,
  this.actions = const <NotificationAction>[],
  this.color,
  this.vibrationPattern,
  this.category,
  this.threadIdentifier,
  this.collapseKey,
  this.ttl,
  this.deliveryDelay,
  this.isScheduled = false,
  this.scheduledDateTime,
  this.repeatInterval,
  this.payload,
  this.showTimestamp = true,
  this.ongoing = false,
  this.autoCancel = true,
  this.silent = false,
  this.publicVersion,
  this.ticker,
  this.whenTimestamp,
  this.usesChronometer = false,
  this.chronometerCountDown = false,
  this.enableLights = true,
  this.enableVibration = true,
  this.playSound = true,
  this.criticalAlert = false,
  this.interruptionLevel = InterruptionLevel.active,
});