currentUserLastMessageAtStream property

Stream<DateTime?> get currentUserLastMessageAtStream

The date of the last message sent by the current user as a stream.

Implementation

Stream<DateTime?> get currentUserLastMessageAtStream {
  _checkInitialized();

  return CombineLatestStream.combine2<bool, List<Message>?, DateTime?>(
    state!.isUpToDateStream,
    state!.channelStateStream.map((state) => state.messages),
    (isUpToDate, messages) {
      // If the channel is not up to date, we can't rely on the last message
      // from the current user.
      if (!isUpToDate) return null;
      return _currentUserLastMessageAt(messages);
    },
  );
}