NotificationPayload class
Content and display options for a local notification.
Constructors
-
NotificationPayload({required int id, required String title, required String body, required String channelId, Map<
String, dynamic> data = const {}, String? soundName, bool silent = false}) -
Creates the content and display options for a local notification.
const
-
NotificationPayload.fromMap(Map<
String, dynamic> map) -
Creates a payload from its serialized
map.factory
Properties
- body → String
-
Notification body text.
final
- channelId → String
-
Identifier of the configured notification channel.
final
-
data
→ Map<
String, dynamic> -
Application data delivered with the notification interaction.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → int
-
Identifier used to update or cancel this notification.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- silent → bool
-
Whether the notification should be presented without sound.
final
- soundName → String?
-
Optional key selecting a sound from the configured sound assets.
final
- title → String
-
Notification title.
final
Methods
-
copyWith(
{int? id, String? title, String? body, String? channelId, Map< String, dynamic> ? data, String? soundName, bool? silent}) → NotificationPayload - Returns a copy with the supplied non-null fields replaced.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
) → Map< String, dynamic> - Serializes this payload to a map accepted by fromMap.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited