MRoomSummary class abstract
Represents a summary of a room, including the number of joined members and invited members.
The joinedMembers
field represents the count of joined members in the room.
The invitedMembers
field represents the count of invited members in the room.
This class corresponds to the room summary 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-summary-object.
To create an instance of RoomSummary
, use the provided factory constructors or the fromJson
method.
It is also possible to create an initial instance of RoomSummary
using the initial
factory constructor.
Example usage:
final roomSummary = RoomSummary.fromJson(jsonData);
final joinedMembers = roomSummary.joinedMembers;
final invitedMembers = roomSummary.invitedMembers;
- Available extensions
- Annotations
-
- @Freezed.new(makeCollectionsUnmodifiable: false)
Constructors
- MRoomSummary({@JsonKey.new(name: 'm.joined_member_count', defaultValue: 0) int? joinedMembers, @JsonKey.new(name: 'm.invited_member_count', defaultValue: 0) int? invitedMembers})
-
Creates a MRoomSummary instance.
factory
-
MRoomSummary.fromJson(Map<
String, dynamic> json) -
Creates a MRoomSummary instance from a JSON map.
factory
- MRoomSummary.initial()
-
Creates an initial MRoomSummary instance.
factory
Properties
-
copyWith
→ $MRoomSummaryCopyWith<
MRoomSummary> -
Create a copy of MRoomSummary
with the given fields replaced by the non-null parameter values.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- invitedMembers → int?
-
no setterinherited
- joinedMembers → int?
-
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
map<
TResult extends Object?> (TResult $default(_MRoomSummary value)) → TResult -
Available on MRoomSummary, provided by the MRoomSummaryPatterns extension
Aswitch
-like method, using callbacks. -
mapOrNull<
TResult extends Object?> (TResult? $default(_MRoomSummary value)?) → TResult? -
Available on MRoomSummary, provided by the MRoomSummaryPatterns extension
A variant ofmap
that fallback to returningnull
. -
maybeMap<
TResult extends Object?> (TResult $default(_MRoomSummary value)?, {required TResult orElse()}) → TResult -
Available on MRoomSummary, provided by the MRoomSummaryPatterns extension
A variant ofmap
that fallback to returningorElse
. -
maybeWhen<
TResult extends Object?> (TResult $default(int? joinedMembers, int? invitedMembers)?, {required TResult orElse()}) → TResult -
Available on MRoomSummary, provided by the MRoomSummaryPatterns extension
A variant ofwhen
that fallback to anorElse
callback. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Serializes this MRoomSummary to a JSON map.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
when<
TResult extends Object?> (TResult $default(int? joinedMembers, int? invitedMembers)) → TResult -
Available on MRoomSummary, provided by the MRoomSummaryPatterns extension
Aswitch
-like method, using callbacks. -
whenOrNull<
TResult extends Object?> (TResult? $default(int? joinedMembers, int? invitedMembers)?) → TResult? -
Available on MRoomSummary, provided by the MRoomSummaryPatterns extension
A variant ofwhen
that fallback to returningnull
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited