MRoom 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 MRoom, use the provided factory constructors or the fromJson method. It is also possible to create an initial instance of MRoom 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

MRoom.new({@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') MRoomTimeline? timeline, @JsonKey(name: 'state') MRoomState? state, @JsonKey(name: 'ephemeral') MEphemeral? ephemeral, @JsonKey(name: 'unread_notifications') MRoomUnreadNotifications? unreadNotifications, @JsonKey(name: 'summary') MRoomSummary? summary, @JsonKey(name: 'invite_state') MInviteEventState? inviteState, @JsonKey(name: 'invite') bool? invite, @JsonKey(name: 'm.heroes') List<String?>? onlineMembers})
Creates a MRoom instance.
factory
MRoom.fromJson(Map<String, dynamic> json)
Creates a MRoom instance from a JSON map.
factory
MRoom.initial()
Creates an initial MRoom instance.
factory

Properties

alias String?
no setterinherited
avatarUri String?
no setterinherited
copyWith → $MRoomCopyWith<MRoom>
Create a copy of MRoom with the given fields replaced by the non-null parameter values.
no setterinherited
ephemeral MEphemeral?
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
invite bool?
no setterinherited
inviteState MInviteEventState?
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 MRoomState?
no setterinherited
summary MRoomSummary?
no setterinherited
timeline MRoomTimeline?
no setterinherited
topic String?
no setterinherited
totalJoinedMembers int?
no setterinherited
unreadNotifications MRoomUnreadNotifications?
no setterinherited

Methods

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

Operators

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