Room class
Represents a Matrix room
The roomID field represents the unique identifier of the room. The name field represents the name of the room. The alias field represents the canonical alias of the room. The topic field represents the topic of the room. The avatarUri field represents the avatar URL of the room. The totalJoinedMembers field represents the total number of joined members in the room.
The timeline field represents the timeline of events in the room. The state field represents the state events in the room. The ephemeral field represents the ephemeral events in the room. The unreadNotifications field represents the unread notifications in the room. The summary field represents the summary information of the room.
The inviteState field represents the invite event state in the room. The invite field indicates whether the user is invited to the room. The onlineMembers field represents the list of online members in the room.
This class corresponds to the room object defined in the Matrix API specification. For more details, refer to the API documentation at https://matrix.org/docs/spec/client_server/latest#room-object.
To create an instance of Room, use the provided factory constructors or the fromJson
method.
It is also possible to create an initial instance of Room using the initial
factory constructor.
Example usage:
final room = Room.fromJson(jsonData);
final roomID = room.roomID;
final timeline = room.timeline;
- Annotations
-
- @Freezed(makeCollectionsUnmodifiable: false)
Constructors
-
Room({@JsonKey(name: 'room_id') String? roomID, @JsonKey(name: 'name') String? name, @JsonKey(name: 'canonical_alias') String? alias, @JsonKey(name: 'topic') String? topic, @JsonKey(name: 'avatar_url') String? avatarUri, @JsonKey(name: 'num_joined_members') int? totalJoinedMembers, @JsonKey(name: 'timeline') RoomTimeline? timeline, @JsonKey(name: 'state') RoomState? state, @JsonKey(name: 'ephemeral') Ephemeral? ephemeral, @JsonKey(name: 'unread_notifications') RoomUnreadNotifications? unreadNotifications, @JsonKey(name: 'summary') RoomSummary? summary, @JsonKey(name: 'invite_state') InviteEventState? inviteState, @JsonKey(name: 'invite') bool? invite, @JsonKey(name: 'm.heroes') List<
String?> ? onlineMembers}) -
Creates a Room instance.
factory
-
Room.fromJson(Map<
String, dynamic> json) -
Creates a Room instance from a JSON map.
factory
- Room.initial()
-
Creates an initial Room instance.
factory
Properties
- alias → String?
-
no setterinherited
- avatarUri → String?
-
no setterinherited
-
copyWith
→ $RoomCopyWith<
Room> -
no setterinherited
- ephemeral → Ephemeral?
-
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- invite → bool?
-
no setterinherited
- inviteState → InviteEventState?
-
no setterinherited
- name → String?
-
no setterinherited
-
onlineMembers
→ List<
String?> ? -
no setterinherited
- roomID → String?
-
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → RoomState?
-
no setterinherited
- summary → RoomSummary?
-
no setterinherited
- timeline → RoomTimeline?
-
no setterinherited
- topic → String?
-
no setterinherited
- totalJoinedMembers → int?
-
no setterinherited
- unreadNotifications → RoomUnreadNotifications?
-
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