RxChatImpl class

RxChat implementation backed by local storage.

Inheritance

Constructors

RxChatImpl(ChatRepository _chatRepository, ChatDriftProvider _driftChat, DraftDriftProvider _draftLocal, ChatItemDriftProvider _driftItems, ChatMemberDriftProvider _driftMembers, DtoChat dto)

Properties

avatar Rx<Avatar?>
Reactive Avatar of this chat.
final
blocked bool
Indicates whether this RxChat is blocked or not.
no setterinherited
callCover UserCallCover?
Returns an actual UserCallCover of this RxChat.
no setteroverride
chat Rx<Chat>
Reactive value of a Chat this RxChat represents.
final
draft Rx<ChatMessage?>
ChatMessage being a draft in this chat.
final
dto DtoChat
DtoChat persisted and applied.
getter/setter pair
firstUnread Rx<ChatItem>?
Returns the first ChatItem unread by the currently authenticated MyUser in this chat.
no setteroverride
fragments List<MessagesPaginated>
MessagesPaginateds created by this RxChatImpl.
final
hashCode int
The hash code for this object.
no setterinherited
hasNext RxBool
Indicates whether the messages have next page.
no setteroverride
hasPrevious RxBool
Indicates whether the messages have previous page.
no setteroverride
id ChatId
Returns a ChatId of the chat.
no setterinherited
inCall RxBool
Indicates whether this chat has an OngoingCall active on this device.
latefinal
lastItem ChatItem?
Returns the last ChatItem of this RxChat.
no setteroverride
me UserId?
Returns MyUser's UserId.
no setteroverride
members MembersPaginated
Paginated of Users being members of this chat.
latefinaloverride-getter
messages RxObsList<Rx<ChatItem>>
Observable list of ChatItems of the chat.
final
nextLoading RxBool
Indicates whether a next page of the messages is loading.
no setteroverride
previousLoading RxBool
Indicates whether a previous page of the messages is loading.
no setteroverride
reads RxList<LastChatRead>
LastChatReads of this chat.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status Rx<RxStatus>
Status of the messages fetching.
final
subscribed bool
Indicates whether this RxChat is listening to the remote updates.
no setter
title String
Text representing the title of this chat.
no setteroverride
typingUsers RxList<User>
List of Users currently typing in this chat.
final
unreadCount RxInt
Count of ChatItems unread by the authenticated MyUser in this RxChat.
final
updates Stream<void>
Listens to the updates of this RxChat while the returned Stream is listened to.
no setteroverride
ver ChatVersion?
ChatVersion of this RxChatImpl.
getter/setter pair

Methods

around({ChatItemId? item, ChatItemId? reply, ChatItemId? forward, ChatMessageText? withText}) Future<Paginated<ChatItemId, Rx<ChatItem>>?>
Fetches the Paginated page around the item, if specified, or messages around the firstUnread otherwise.
override
attachments({ChatItemId? item}) Paginated<ChatItemId, Rx<ChatItem>>
Returns the Paginated of ChatItems having any Attachments posted in this chat around the provided item, if any.
override
clear() Future<void>
Clears the _pagination and fragments.
compareTo(RxChat other) int
Compares this object to another object.
override
dispose() Future<void>
Disposes this RxChatImpl.
ensureDraft() Future<void>
Ensures the draft is initialized.
override
get(ChatItemId itemId) Future<DtoChatItem?>
Returns the stored or fetched DtoChatItem identified by the provided itemId.
init() Future<void>
Initializes this RxChatImpl.
next() Future<void>
Fetches the next messages page.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
postChatMessage({ChatItemId? existingId, PreciseDateTime? existingDateTime, ChatMessageText? text, List<Attachment>? attachments, List<ChatItem> repliesTo = const []}) Future<ChatItem>
Posts a new ChatMessage to the specified Chat by the authenticated MyUser.
previous() Future<void>
Fetches the previous messages page.
override
put(DtoChatItem item, {bool ignoreBounds = false}) Future<void>
Adds the provided item to the Paginations.
read(ChatItemId untilId) Future<void>
Marks this RxChat as read until the provided ChatItem for the authenticated MyUser,
remove(ChatItemId itemId) Future<void>
Removes a ChatItem identified by its id.
override
setDraft({ChatMessageText? text, List<Attachment> attachments = const [], List<ChatItem> repliesTo = const []}) Future<void>
Updates the draft with the provided text, attachments and repliesTo.
override
single(ChatItemId item) Future<Paginated<ChatItemId, Rx<ChatItem>>?>
Fetches a single ChatItem in the Paginated page identified by the provided id.
override
toString() String
A string representation of this object.
inherited
updateAttachments(ChatItem item) Future<void>
Updates the Attachments of the specified item to be up-to-date.
override
updateAvatar() Future<void>
Updates the avatar of the chat.
override
updateChat(DtoChat newChat) Future<void>
Updates the chat and chat-related resources with the provided newChat.
updateReads() → void
Recalculates the reads to represent the actual messages.

Operators

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