NotificationEntity class
Represents a notification entity in the domain layer.
Constructors
-
NotificationEntity.new({required String id, required String title, required String body, required DateTime timestamp, Map<
String, dynamic> data = const <String, dynamic>{}, String? imageUrl, String? icon, String? channelId, bool isDelivered = false, bool isRead = false, DateTime? deliveryTime, DateTime? openedTime, NotificationSource source = NotificationSource.local}) -
Creates a new notification entity.
const
-
NotificationEntity.fromMap(Map<
String, dynamic> map) -
Creates a notification entity from a map.
factory
- NotificationEntity.fromPayload(NotificationPayload payload)
-
Creates a notification entity from a notification payload.
factory
Properties
- body → String
-
The body content of the notification.
final
- channelId → String?
-
The channel ID of the notification.
final
-
data
→ Map<
String, dynamic> -
Additional data associated with the notification.
final
- deliveryTime → DateTime?
-
The time when the notification was delivered.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → String?
-
The icon of the notification.
final
- id → String
-
The unique identifier of the notification.
final
- imageUrl → String?
-
The image URL of the notification.
final
- isDelivered → bool
-
Whether the notification has been delivered.
final
- isRead → bool
-
Whether the notification has been read/opened.
final
- openedTime → DateTime?
-
The time when the notification was opened.
final
-
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- source → NotificationSource
-
The source of the notification.
final
- stringify → bool?
-
If set to
true
, thetoString
method will be overridden to output this instance'sprops
.no setterinherited - timestamp → DateTime
-
The timestamp when the notification was created.
final
- title → String
-
The title of the notification.
final
Methods
-
copyWith(
{String? id, String? title, String? body, Map< String, dynamic> ? data, String? imageUrl, String? icon, String? channelId, DateTime? timestamp, bool? isDelivered, bool? isRead, DateTime? deliveryTime, DateTime? openedTime, NotificationSource? source}) → NotificationEntity - Creates a copy of this notification entity with updated fields.
-
fromJson(
String json) → NotificationEntity -
Converts the object from a JSON string representation.
inherited
-
fromMap(
Map< String, dynamic> map) → NotificationEntity - 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