lastItem property

  1. @override
ChatItem? get lastItem
override

Returns the last ChatItem of this RxChat.

Implementation

@override
ChatItem? get lastItem {
  ChatItem? item = chat.value.lastItem;
  if (messages.isNotEmpty) {
    final ChatItem last = messages.last.value;
    if (item?.at.isBefore(last.at) == true) {
      item = last;
    }
  }

  return item;
}