Skip to main content

ChatService class

ChatService class provides different services for direct chats of the user.

Services include:

  • sendMessageToDirectChat - used to send messages.
  • getDirectChatsByUserId - used to get all chats by the user.
  • getDirectChatMessagesByChatId - used to get all chats of a user with another user.

Constructors

ChatService ()

Properties

chatListStreamStream<ChatListTileDataModel>

read-only

chatMessagesStreamStream<ChatMessage>

read-only

chatStreamStream<QueryResult<Object?>>

read / write

hashCodeint

The hash code for this object.
read-onlyinherited

runtimeTypeType

A representation of the runtime type of the object.
read-onlyinherited

Methods

getDirectChatMessagesByChatId(dynamic chatId) Future<void>

This function is used to get all the chat messages of a particular chat by the user.

getDirectChatsByUserId() Future<void>

This function is used to get all the chats by the user.

noSuchMethod(Invocation invocation) dynamic

Invoked when a non-existent method or property is accessed.
inherited

sendMessageToDirectChat(String chatId, String messageContent) Future<void>

This function is used to send the message in the direct chats.

toString() String

A string representation of this object.
inherited

Operators

operator ==(Object other) bool

The equality operator.
inherited