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})
const
factory
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
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

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>(TResult? $default(_NotificationMessage value)?) → TResult?

Available on NotificationMessage, provided by the NotificationMessagePatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>(TResult $default(_NotificationMessage value)?, {required TResult orElse()}) → TResult

Available on NotificationMessage, provided by the NotificationMessagePatterns extension

A variant of map that fallback to returning orElse.
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 of when that fallback to an orElse callback.
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

A switch-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 of when that fallback to returning null

Operators

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