Event class
The class that contains the information about an event
- Available extensions
- Annotations
-
- @JsonSerializable.new(includeIfNull: false)
Constructors
-
Event({String type = 'local.event', String? userId, String? cid, String? connectionId, DateTime? createdAt, OwnUser? me, User? user, Message? message, Poll? poll, PollVote? pollVote, int? totalUnreadCount, int? unreadChannels, Reaction? reaction, bool? online, ChannelModel? channel, Member? member, String? channelId, String? channelType, DateTime? channelLastMessageAt, String? parentId, bool? hardDelete, AITypingState? aiState, String? aiMessage, String? messageId, Thread? thread, int? unreadThreadMessages, int? unreadThreads, DateTime? lastReadAt, int? unreadMessages, String? lastReadMessageId, Draft? draft, MessageReminder? reminder, PushPreference? pushPreference, ChannelPushPreference? channelPushPreference, int? channelMessageCount, DateTime? lastDeliveredAt, String? lastDeliveredMessageId, Map<
String, Object?> extraData = const {}, bool isLocal = true}) - Constructor used for json serialization
-
Event.fromJson(Map<
String, dynamic> json) -
Create a new instance from a json
factory
Properties
- aiMessage → String?
-
Additional message from the AI assistant.
final
- aiState → AITypingState?
-
The current state of the AI assistant.
final
- channel → ChannelModel?
-
The channel sent with the event
final
- channelId → String?
-
The channel id to which the event belongs
final
- channelLastMessageAt → DateTime?
-
The dateTime at which the last message was sent in the channel.
final
- channelMessageCount → int?
-
The total number of messages in the channel.
final
- channelPushPreference → ChannelPushPreference?
-
Push notification preferences for the current user for this channel.
final
- channelType → String?
-
The channel type to which the event belongs
final
- cid → String?
-
The channel cid to which the event belongs
final
- connectionId → String?
-
The connection id in which the event has been sent
final
- createdAt → DateTime
-
The date of creation of the event
final
- draft → Draft?
-
The draft sent with the event.
final
-
extraData
→ Map<
String, Object?> -
Map of custom channel extraData
final
- hardDelete → bool?
-
This is true if the message has been hard deleted
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isLocal → bool
-
True if the event is generated by this client
final
- lastDeliveredAt → DateTime?
-
The date of the last delivered message.
final
- lastDeliveredMessageId → String?
-
The id of the last delivered message.
final
- lastReadAt → DateTime?
-
Create date of the last read message (notification.mark_unread)
final
- lastReadMessageId → String?
-
The id of the last read message (notification.mark_read)
final
- me → OwnUser?
-
User object of the health check user
final
- member → Member?
-
The member sent with the event
final
- message → Message?
-
The message sent with the event
final
- messageId → String?
-
The message id to which the event belongs.
final
- online → bool?
-
Online status
final
- parentId → String?
-
The id of the parent message of a thread
final
- poll → Poll?
-
The poll sent with the event
final
- pollVote → PollVote?
-
The poll vote sent with the event
final
- pushPreference → PushPreference?
-
Push notification preferences for the current user.
final
- reaction → Reaction?
-
The reaction sent with the event
final
- reminder → MessageReminder?
-
The message reminder sent with the event.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- thread → Thread?
-
The thread object sent with the event.
final
- totalUnreadCount → int?
-
The number of unread messages for current user
final
- type → String
-
The type of the event
EventType contains some predefined constant types
final
- unreadChannels → int?
-
User total unread channels
final
- unreadMessages → int?
-
The number of unread messages (notification.mark_unread)
final
- unreadThreadMessages → int?
-
The number of unread thread messages.
final
- unreadThreads → int?
-
The number of unread threads.
final
- user → User?
-
User object of the current user
final
- userId → String?
-
The user id of the user to which the event belongs
final
Methods
-
copyWith(
{String? type, String? userId, String? cid, String? channelId, String? channelType, DateTime? channelLastMessageAt, String? connectionId, DateTime? createdAt, OwnUser? me, User? user, Message? message, Poll? poll, PollVote? pollVote, ChannelModel? channel, Member? member, Reaction? reaction, int? totalUnreadCount, int? unreadChannels, bool? online, String? parentId, bool? hardDelete, AITypingState? aiState, String? aiMessage, String? messageId, Thread? thread, int? unreadThreadMessages, int? unreadThreads, DateTime? lastReadAt, int? unreadMessages, String? lastReadMessageId, Draft? draft, MessageReminder? reminder, PushPreference? pushPreference, ChannelPushPreference? channelPushPreference, int? channelMessageCount, DateTime? lastDeliveredAt, String? lastDeliveredMessageId, Map< String, Object?> ? extraData}) → Event - Creates a copy of Event with specified attributes overridden.
-
isFromUser(
{String? userId}) → bool -
Available on Event, provided by the EventExtension extension
Whether the event is from the given user. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Serialize to json
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
topLevelFields
→ List<
String> -
Known top level fields.
Useful for
Serializermethods.final