setReadMarker method

Future<void> setReadMarker({
  1. String? eventId,
  2. bool? public,
})

Set the read marker to the last synced event in this timeline.

Implementation

Future<void> setReadMarker({String? eventId, bool? public}) async {
  eventId ??=
      events.firstWhereOrNull((event) => event.status.isSynced)?.eventId;
  if (eventId == null) return;
  return room.setReadMarker(eventId, mRead: eventId, public: public);
}