NotificationMessage class abstract
A normalized FCM or local notification.
- Available extensions
- Annotations
-
- @freezed
Constructors
-
NotificationMessage({required int notificationId, required String messageId, String? title, String? body, String? imageUrl, @Default.new(<String, Object?>{}) Map<
String, Object?> data, @Default.new(<NotificationAction>[]) List<NotificationAction> actions, @Default.new('fcm_actions_default') String channelId, String? categoryId, String? routeType, String? deepLink, DateTime? sentAt, String? topic, String? collapseKey, @Default.new(false) bool silent, @Default.new(<String, Object?>{}) Map<String, Object?> rawJson}) -
constfactory
-
NotificationMessage.fromJson(Map<
String, Object?> json) -
factory
Properties
-
actions
→ List<
NotificationAction> -
no setterinherited
- body → String?
-
no setterinherited
- categoryId → String?
-
no setterinherited
- channelId → String
-
no setterinherited
- collapseKey → String?
-
no setterinherited
-
copyWith
→ $NotificationMessageCopyWith<
NotificationMessage> -
Create a copy of NotificationMessage
with the given fields replaced by the non-null parameter values.
no setterinherited
-
data
→ Map<
String, Object?> -
no setterinherited
- deepLink → String?
-
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- imageUrl → String?
-
no setterinherited
- messageId → String
-
no setterinherited
- notificationId → int
-
no setterinherited
-
rawJson
→ Map<
String, Object?> -
no setterinherited
- routeType → String?
-
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sentAt → DateTime?
-
no setterinherited
- silent → bool
-
no setterinherited
- title → String?
-
no setterinherited
- topic → String?
-
no setterinherited
Methods
-
map<
TResult extends Object?> (TResult $default(_NotificationMessage value)) → TResult -
Available on NotificationMessage, provided by the NotificationMessagePatterns extension
Aswitch-like method, using callbacks. -
mapOrNull<
TResult extends Object?> (TResult? $default(_NotificationMessage value)?) → TResult? -
Available on NotificationMessage, provided by the NotificationMessagePatterns extension
A variant ofmapthat fallback to returningnull. -
maybeMap<
TResult extends Object?> (TResult $default(_NotificationMessage value)?, {required TResult orElse()}) → TResult -
Available on NotificationMessage, provided by the NotificationMessagePatterns extension
A variant ofmapthat fallback to returningorElse. -
maybeWhen<
TResult extends Object?> (TResult $default(int notificationId, String messageId, String? title, String? body, String? imageUrl, Map< String, Object?> data, List<NotificationAction> actions, String channelId, String? categoryId, String? routeType, String? deepLink, DateTime? sentAt, String? topic, String? collapseKey, bool silent, Map<String, Object?> rawJson)?, {required TResult orElse()}) → TResult -
Available on NotificationMessage, provided by the NotificationMessagePatterns extension
A variant ofwhenthat fallback to anorElsecallback. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Serializes this NotificationMessage to a JSON map.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
when<
TResult extends Object?> (TResult $default(int notificationId, String messageId, String? title, String? body, String? imageUrl, Map< String, Object?> data, List<NotificationAction> actions, String channelId, String? categoryId, String? routeType, String? deepLink, DateTime? sentAt, String? topic, String? collapseKey, bool silent, Map<String, Object?> rawJson)) → TResult -
Available on NotificationMessage, provided by the NotificationMessagePatterns extension
Aswitch-like method, using callbacks. -
whenOrNull<
TResult extends Object?> (TResult? $default(int notificationId, String messageId, String? title, String? body, String? imageUrl, Map< String, Object?> data, List<NotificationAction> actions, String channelId, String? categoryId, String? routeType, String? deepLink, DateTime? sentAt, String? topic, String? collapseKey, bool silent, Map<String, Object?> rawJson)?) → TResult? -
Available on NotificationMessage, provided by the NotificationMessagePatterns extension
A variant ofwhenthat fallback to returningnull
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited