ChatwootClient class FlutterClientSdk

Represents a chatwoot client instance. All chatwoot operations (Example: sendMessages) are passed through chatwoot client. For more info visit https://www.chatwoot.com/docs/product/channels/api/client-apis

Properties

baseUrl String
no setter
callbacks ChatwootCallbacks?
final
hashCode int
The hash code for this object.
no setterinherited
inboxIdentifier String
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
user ChatwootUser?
final

Methods

clearClientData() → dynamic
Clears all chatwoot client data
dispose() → dynamic
Disposes chatwoot client and cancels all stream subscriptions
loadMessages() → void
Retrieves chatwoot client's messages. If persistence is enabled ChatwootCallbacks.onPersistedMessagesRetrieved will be triggered with persisted messages. On successfully fetch from remote server ChatwootCallbacks.onMessagesRetrieved will be triggered
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sendAction(ChatwootActionType action) Future<void>
Send chatwoot action performed by user.
sendMessage({required String content, required String echoId}) Future<void>
Sends chatwoot message. The echoId is your temporary message id. When message sends successfully ChatwootMessage will be returned with the echoId on ChatwootCallbacks.onMessageSent. If message fails to send ChatwootCallbacks.onError will be triggered echoId as data.
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

providerContainerMap Map<String, ProviderContainer>
getter/setter pair

Static Methods

clearAllData() Future<void>
Clears all persisted chatwoot data on device.
clearData({required String baseUrl, required String inboxIdentifier, String? userIdentifier}) Future<void>
Clears all persisted chatwoot data on device for a particular chatwoot client instance. See getClientInstanceKey on how chatwoot client instance are differentiated
create({required String baseUrl, required String inboxIdentifier, ChatwootUser? user, bool enablePersistence = true, ChatwootCallbacks? callbacks}) Future<ChatwootClient>
Creates an instance of ChatwootClient with the baseUrl of your chatwoot installation, inboxIdentifier for the targeted inbox. Specify custom user details using user and callbacks for handling chatwoot events. By default persistence is enabled, to disable persistence set enablePersistence as false
getClientInstanceKey({required String baseUrl, required String inboxIdentifier, String? userIdentifier}) String
Create a chatwoot client instance key using the chatwoot client instance baseurl, inboxIdentifier and userIdentifier. Client instance keys are used to differentiate between client instances and their data (contact (ChatwootContact),conversation (ChatwootConversation) and messages (ChatwootMessage))