Event class
The class that contains the information about an event
- Annotations
-
- @JsonSerializable()
Constructors
-
Event({String type = 'local.event', String? cid, String? connectionId, DateTime? createdAt, OwnUser? me, User? user, Message? message, int? totalUnreadCount, int? unreadChannels, Reaction? reaction, bool? online, EventChannel? channel, Member? member, String? channelId, String? channelType, String? parentId, bool? hardDelete, 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
- channel → EventChannel?
-
The channel sent with the event
final
- channelId → String?
-
The channel id to which the event belongs
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
-
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
- 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
- online → bool?
-
Online status
final
- parentId → String?
-
The id of the parent message of a thread
final
- reaction → Reaction?
-
The reaction sent with the event
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- 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
- user → User?
-
User object of the current user
final
Methods
-
copyWith(
{String? type, String? cid, String? channelId, String? channelType, String? connectionId, DateTime? createdAt, OwnUser? me, User? user, Message? message, EventChannel? channel, Member? member, Reaction? reaction, int? totalUnreadCount, int? unreadChannels, bool? online, String? parentId, bool? hardDelete, Map< String, Object?> ? extraData}) → Event - Creates a copy of Event with specified attributes overridden.
-
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
Serializer
methods.final