NotificationPayload class

The notification payload model.

Constructors

NotificationPayload.new({required String id, required String title, required String body, Map<String, dynamic> data = const <String, dynamic>{}, String? imageUrl, String? icon, String? sound, String? badge, String? tag, String? channelId, String? channelName, String? channelDescription, NotificationImportance importance = NotificationImportance.defaultImportance, NotificationPriority priority = NotificationPriority.defaultPriority, DateTime? timestamp, String? largeIcon, String? bigPicture, List<NotificationAction> actions = const <NotificationAction>[], String? color, List<int>? vibrationPattern, String? category, String? threadIdentifier, String? collapseKey, int? ttl, Duration? deliveryDelay, bool isScheduled = false, DateTime? scheduledDateTime, RepeatInterval? repeatInterval, String? payload, bool showTimestamp = true, bool ongoing = false, bool autoCancel = true, bool silent = false, NotificationPayload? publicVersion, String? ticker, int? whenTimestamp, bool usesChronometer = false, bool chronometerCountDown = false, bool enableLights = true, bool enableVibration = true, bool playSound = true, bool criticalAlert = false, InterruptionLevel interruptionLevel = InterruptionLevel.active})
The constructor of the notification payload.
const
NotificationPayload.fromMap(Map<String, dynamic> map)
The factory constructor of the notification payload.
factory

Properties

actions List<NotificationAction>
The actions of the notification.
final
autoCancel bool
Whether the notification should be automatically canceled.
final
badge String?
The badge of the notification.
final
bigPicture String?
The big picture of the notification.
final
body String
The body of the notification.
final
category String?
The category of the notification.
final
channelDescription String?
The channel description of the notification.
final
channelId String?
The channel ID of the notification.
final
channelName String?
The channel name of the notification.
final
chronometerCountDown bool
Whether the notification uses a chronometer count down.
final
collapseKey String?
The collapse key of the notification.
final
color String?
The color of the notification.
final
criticalAlert bool
Whether the notification is a critical alert.
final
data Map<String, dynamic>
The data of the notification.
final
deliveryDelay Duration?
The delivery delay of the notification.
final
enableLights bool
Whether the notification enables lights.
final
enableVibration bool
Whether the notification enables vibration.
final
hashCode int
The hash code for this object.
no setterinherited
icon String?
The icon of the notification.
final
id String
The unique identifier for the notification.
final
imageUrl String?
The image URL of the notification.
final
importance NotificationImportance
The importance of the notification.
final
interruptionLevel InterruptionLevel
The interruption level of the notification.
final
isScheduled bool
Whether the notification is scheduled.
final
largeIcon String?
The large icon of the notification.
final
ongoing bool
Whether the notification is ongoing.
final
payload String?
The payload of the notification.
final
playSound bool
Whether the notification plays a sound.
final
priority NotificationPriority
The priority of the notification.
final
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setter
publicVersion NotificationPayload?
The public version of the notification.
final
repeatInterval RepeatInterval?
The repeat interval of the notification.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scheduledDateTime DateTime?
The scheduled date time of the notification.
final
showTimestamp bool
Whether to show the timestamp of the notification.
final
silent bool
Whether the notification is silent.
final
sound String?
The sound of the notification.
final
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
tag String?
The tag of the notification.
final
threadIdentifier String?
The thread identifier of the notification.
final
ticker String?
The ticker of the notification.
final
timestamp DateTime?
The timestamp of the notification.
final
title String
The title of the notification.
final
ttl int?
The time to live of the notification.
final
usesChronometer bool
Whether the notification uses a chronometer.
final
vibrationPattern List<int>?
The vibration pattern of the notification.
final
whenTimestamp int?
The when timestamp of the notification.
final

Methods

copyWith({String? id, String? title, String? body, Map<String, dynamic>? data, String? imageUrl, String? icon, String? sound, String? badge, String? tag, String? channelId, String? channelName, String? channelDescription, NotificationImportance? importance, NotificationPriority? priority, DateTime? timestamp, String? largeIcon, String? bigPicture, List<NotificationAction>? actions, String? color, List<int>? vibrationPattern, String? category, String? threadIdentifier, String? collapseKey, int? ttl, Duration? deliveryDelay, bool? isScheduled, DateTime? scheduledDateTime, RepeatInterval? repeatInterval, String? payload, bool? showTimestamp, bool? ongoing, bool? autoCancel, bool? silent, NotificationPayload? publicVersion, String? ticker, int? whenTimestamp, bool? usesChronometer, bool? chronometerCountDown, bool? enableLights, bool? enableVibration, bool? playSound, bool? criticalAlert, InterruptionLevel? interruptionLevel}) NotificationPayload
Copy with new values.
fromJson(String json) NotificationPayload
Converts the object from a JSON string representation.
inherited
fromMap(Map<String, dynamic> map) NotificationPayload
Converts the object from a Map representation.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() String
Converts the object to a JSON string representation.
inherited
toMap() Map<String, dynamic>
Converts the BaseDataModel object to a Map representation.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited