markRead method

Future<EmptyResponse> markRead({
  1. String? messageId,
})

Mark all messages as read.

Optionally provide a messageId if you want to mark channel as read from a particular message onwards.

Implementation

Future<EmptyResponse> markRead({String? messageId}) async {
  _checkInitialized();
  client.state.totalUnreadCount =
      max(0, (client.state.totalUnreadCount) - (state!.unreadCount));
  state!.unreadCount = 0;
  return _client.markChannelRead(id!, type, messageId: messageId);
}