ChatService class

Service responsible for Chats related functionality.

Inheritance

Constructors

ChatService(AbstractChatRepository _chatRepository, AuthService _authService)

Properties

chats RxObsMap<ChatId, RxChat>
Returns the current reactive map of all RxChats available.
no setter
hashCode int
The hash code for this object.
no setterinherited
hasNext RxBool
Indicates whether the paginated have next page.
no setter
initialized bool
Checks whether the controller has already been initialized.
no setterinherited
isClosed bool
Checks whether the controller has already been closed.
no setterinherited
me UserId?
Returns MyUser's UserId.
no setter
monolog ChatId
Returns ChatId of the Chat-monolog of the currently authenticated MyUser, if any.
no setter
nextLoading RxBool
Indicates whether a next page of the paginated is loading.
no setter
onDelete InternalFinalCallback<void>
Internal callback that starts the cycle of this controller.
finalinherited
onStart InternalFinalCallback<void>
Called at the exact moment the widget is allocated in memory. It uses an internal "callable" type, to avoid any @overrides in subclases. This method should be internal and is required to define the lifetime cycle of the subclass.
finalinherited
paginated RxObsMap<ChatId, RxChat>
Returns the reactive map of the currently paginated RxChats.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status Rx<RxStatus>
Returns the RxStatus of the paginated initialization.
no setter

Methods

$configureLifeCycle() → void
inherited
addChatMember(ChatId chatId, UserId userId) Future<void>
Adds an User to a Chat-group by the authority of the authenticated MyUser.
clearChat(ChatId id, [ChatItemId? untilId]) Future<void>
Clears an existing Chat (hides all its ChatItems) for the authenticated MyUser until the specified ChatItem inclusively.
Creates a new ChatDirectLink with the specified ChatDirectLinkSlug and deletes the current active ChatDirectLink of the given Chat-group (if any).
createGroupChat(List<UserId> memberIds, {ChatName? name}) Future<RxChat>
Creates a group Chat with the provided members and the authenticated MyUser, optionally named.
Deletes the current ChatDirectLink of the given Chat-group.
deleteChatItem(ChatItem item) Future<void>
Deletes the specified ChatItem posted by the authenticated MyUser.
editChatMessage(ChatMessage item, {ChatMessageTextInput? text, ChatMessageAttachmentsInput? attachments, ChatMessageRepliesInput? repliesTo}) Future<void>
Edits the specified ChatMessage posted by the authenticated MyUser.
favoriteChat(ChatId id, [ChatFavoritePosition? position]) Future<void>
Marks the specified Chat as favorited for the authenticated MyUser and sets its position in the favorites list.
forwardChatItems(ChatId from, ChatId to, List<ChatItemQuoteInput> items, {ChatMessageText? text, List<AttachmentId>? attachments}) Future<void>
Forwards ChatItems to the specified Chat by the authenticated MyUser.
get(ChatId id) FutureOr<RxChat?>
Returns a RxChat by the provided id.
hideChat(ChatId id) Future<void>
Marks the specified Chat as hidden for the authenticated MyUser.
hideChatItem(ChatItem item) Future<void>
Hides the specified ChatItem for the authenticated MyUser.
keepTyping(ChatId chatId) Stream
Notifies ChatMembers about the authenticated MyUser typing in the specified Chat at the moment.
next() FutureOr<void>
Fetches the next paginated page.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onClose() → void
Called before onDelete method. onClose might be used to dispose resources used by the controller. Like closing events, or streams before the controller is destroyed. Or dispose objects that can potentially create some memory leaks, like TextEditingControllers, AnimationControllers. Might be useful as well to persist some data on disk.
inherited
onInit() → void
Called immediately after the widget is allocated in memory. You might use this to initialize something for the controller.
override
onReady() → void
Called 1 frame after onInit(). It is the perfect place to enter navigation events, like snackbar, dialogs, or a new route, or async request.
inherited
readChat(ChatId chatId, ChatItemId untilId) Future<void>
Marks the specified Chat as read for the authenticated MyUser until the specified ChatItem inclusively.
removeChatMember(ChatId chatId, UserId userId) Future<void>
Removes an User from a Chat-group by the authority of the authenticated MyUser.
renameChat(ChatId id, ChatName? name) Future<void>
Renames the specified Chat by the authority of authenticated MyUser.
resendChatItem(ChatItem item) Future<void>
Resends the specified item.
sendChatMessage(ChatId chatId, {ChatMessageText? text, List<Attachment>? attachments, List<ChatItem> repliesTo = const []}) Future<void>
Posts a new ChatMessage to the specified Chat by the authenticated MyUser.
toggleChatMute(ChatId id, MuteDuration? mute) Future<void>
Mutes or unmutes the specified Chat for the authenticated MyUser. Overrides an existing mute even if it's longer.
toString() String
A string representation of this object.
inherited
unfavoriteChat(ChatId id) Future<void>
Removes the specified Chat from the favorites list of the authenticated MyUser.
updateChatAvatar(ChatId id, {NativeFile? file, CropAreaInput? crop, void onSendProgress(int count, int total)?}) Future<void>
Updates the Chat.avatar field with the provided image, or resets it to null, by authority of the authenticated MyUser.
uploadAttachment(LocalAttachment attachment) Future<Attachment>
Creates a new Attachment from the provided LocalAttachment linked to the authenticated MyUser for a later use in the sendChatMessage method.

Operators

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