Timeline class

Represents the timeline of a room. The callback onUpdate will be triggered automatically. The initial event list will be retreived when created by the room.getTimeline() method.

Constructors

Timeline({required Room room, void onUpdate()?, void onChange(int index)?, void onInsert(int index)?, void onRemove(int index)?, void onNewEvent()?, required TimelineChunk chunk})

Properties

aggregatedEvents Map<String, Map<String, Set<Event>>>
Map of event ID to map of type to set of aggregated events
final
allowNewEvent bool
getter/setter pair
canRequestFuture bool
no setter
canRequestHistory bool
no setter
chunk ↔ TimelineChunk
getter/setter pair
events List<Event>
no setter
hashCode int
The hash code for this object.
no setterinherited
isFragmentedTimeline bool
getter/setter pair
isRequestingFuture bool
getter/setter pair
isRequestingHistory bool
getter/setter pair
onChange → void Function(int index)?
final
onInsert → void Function(int index)?
final
onNewEvent → void Function()?
final
onRemove → void Function(int index)?
final
onUpdate → void Function()?
final
room Room
final
roomSub StreamSubscription<SyncUpdate>?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sessionIdReceivedSub StreamSubscription<String>?
getter/setter pair
sub StreamSubscription<EventUpdate>?
getter/setter pair

Methods

addAggregatedEvent(Event event) → void
cancelSubscriptions() → void
Don't forget to call this before you dismiss this object!
getEventById(String id) Future<Event?>
Searches for the event in this timeline. If not found, requests from the server. Requested events are cached.
getRoomEvents({int historyCount = Room.defaultHistoryCount, dynamic direction = Direction.b}) Future<int>
Request more previous events from the server. historyCount defines how much events should be received maximum. When the request is answered, onHistoryReceived will be triggered before the historical events will be published in the onEvent stream. Returns the actual count of received timeline events.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeAggregatedEvent(Event event) → void
requestFuture({int historyCount = Room.defaultHistoryCount}) Future<void>
requestHistory({int historyCount = Room.defaultHistoryCount}) Future<void>
requestKeys({bool tryOnlineBackup = true, bool onlineKeyBackupOnly = true}) → void
Request the keys for undecryptable events of this timeline
searchEvent({String? searchTerm, int requestHistoryCount = 100, int maxHistoryRequests = 10, String? sinceEventId, int? limit, bool searchFunc(Event)?}) Stream<List<Event>>
Searches searchTerm in this timeline. It first searches in the cache, then in the database and then on the server. The search can take a while, which is why this returns a stream so the already found events can already be displayed. Override the searchFunc if you need another search. This will then ignore searchTerm.
setReadMarker({String? eventId, bool? public}) Future<void>
Set the read marker to the last synced event in this timeline.
toString() String
A string representation of this object.
inherited

Operators

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