MRoomTimeline class abstract
Represents the timeline events of a room.
The events field contains a list of timeline events.
The prevBatch field contains the previous batch token for pagination.
The limited field indicates whether the timeline events are limited.
This class corresponds to the room timeline 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-timeline-object.
To create an instance of RoomTimeline, use the provided factory constructors or the fromJson method.
It is also possible to create an initial instance of RoomTimeline using the initial factory constructor.
Example usage:
final timeline = RoomTimeline.fromJson(jsonData);
final events = timeline.events;
final prevBatch = timeline.prevBatch;
- Available extensions
- Annotations
-
- @Freezed.new(makeCollectionsUnmodifiable: false)
Constructors
-
MRoomTimeline({@JsonKey.new(name: 'events') List<
MMessage?> ? events, @JsonKey.new(name: 'prev_batch') String? prevBatch, @JsonKey.new(name: 'limited', defaultValue: false) bool? limited}) -
Creates a MRoomTimeline instance.
factory
-
MRoomTimeline.fromJson(Map<
String, dynamic> json) -
Creates a MRoomTimeline instance from a JSON map.
factory
- MRoomTimeline.initial()
-
Creates an initial MRoomTimeline instance.
factory
Properties
-
copyWith
→ $MRoomTimelineCopyWith<
MRoomTimeline> -
Create a copy of MRoomTimeline
with the given fields replaced by the non-null parameter values.
no setterinherited
-
events
→ List<
MMessage?> ? -
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- limited → bool?
-
no setterinherited
- prevBatch → String?
-
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
map<
TResult extends Object?> (TResult $default(_MRoomTimeline value)) → TResult -
Available on MRoomTimeline, provided by the MRoomTimelinePatterns extension
Aswitch-like method, using callbacks. -
mapOrNull<
TResult extends Object?> (TResult? $default(_MRoomTimeline value)?) → TResult? -
Available on MRoomTimeline, provided by the MRoomTimelinePatterns extension
A variant ofmapthat fallback to returningnull. -
maybeMap<
TResult extends Object?> (TResult $default(_MRoomTimeline value)?, {required TResult orElse()}) → TResult -
Available on MRoomTimeline, provided by the MRoomTimelinePatterns extension
A variant ofmapthat fallback to returningorElse. -
maybeWhen<
TResult extends Object?> (TResult $default(List< MMessage?> ? events, String? prevBatch, bool? limited)?, {required TResult orElse()}) → TResult -
Available on MRoomTimeline, provided by the MRoomTimelinePatterns extension
A variant ofwhenthat fallback to anorElsecallback. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Serializes this MRoomTimeline to a JSON map.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
when<
TResult extends Object?> (TResult $default(List< MMessage?> ? events, String? prevBatch, bool? limited)) → TResult -
Available on MRoomTimeline, provided by the MRoomTimelinePatterns extension
Aswitch-like method, using callbacks. -
whenOrNull<
TResult extends Object?> (TResult? $default(List< MMessage?> ? events, String? prevBatch, bool? limited)?) → TResult? -
Available on MRoomTimeline, provided by the MRoomTimelinePatterns extension
A variant ofwhenthat fallback to returningnull
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited