SyncPresence class
Represents the presence information of the user received in a synchronization response.
The events field contains a list of Message objects representing presence events. Each presence event provides information about the presence status of a user in a room.
This class corresponds to the presence field defined in the Matrix API specification. For more details, refer to the API documentation at https://matrix.org/docs/spec/client_server/latest#synchronization.
To create an instance of SyncPresence, use the provided factory constructors or the fromJson
method.
It is also possible to create an initial instance of SyncPresence using the initial
factory constructor.
Example usage:
final presence = SyncPresence.fromJson(jsonData);
final events = presence.events;
- Annotations
-
- @freezed
Constructors
-
SyncPresence({@JsonKey(name: 'events') List<
Message?> ? events}) -
Creates a SyncPresence instance.
factory
-
SyncPresence.fromJson(Map<
String, dynamic> json) -
Creates a SyncPresence instance from a JSON map.
factory
- SyncPresence.initial()
-
Creates an initial SyncPresence instance.
factory
Properties
-
copyWith
→ $SyncPresenceCopyWith<
SyncPresence> -
no setterinherited
-
events
→ List<
Message?> ? -
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited