Notification class

A notification users receive.

Annotations

Constructors

Notification({@JsonKey(name: 'notificationid') required int id, @UnixTimestampConverter() required DateTime timestamp, @UnixTimestampConverter() @JsonKey(name: 'timestamp_read') DateTime? readAt, required NotificationType type, @JsonKey(name: 'info') int? context, @BoolConverter() @JsonKey(name: 'status') required bool read, @JsonKey(name: 'userid') required int userId})
A notification users receive.
const
factory
Notification.fromJson(Map<String, Object?> json)
Creates a Notification from a JSON object.
factory

Properties

context → int?
Additional context for the notification. Interpretation depends on the type.
no setterinherited
copyWith → $NotificationCopyWith<Notification>
Create a copy of Notification with the given fields replaced by the non-null parameter values.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
id → int
The notification's unique identifier.
no setterinherited
read → bool
true if the notification has been read.
no setterinherited
readAt → DateTime?
The timestamp when the notification was read.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
timestamp → DateTime
The timestamp when the notification was sent.
no setterinherited
type → NotificationType
The type of the notification.
no setterinherited
userId → int
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Serializes this Notification to a JSON map.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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