RuutClient class FlutterClientSdk
Represents a ruut chat client instance. All ruut chat operations (Example: sendMessages) are passed through ruut chat client. For more info visit
Properties
- baseUrl → String
-
no setter
- callbacks → RuutCallbacks?
-
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 → RuutUser?
-
final
Methods
-
clearClientData(
) → dynamic - Clears all ruut client data
-
dispose(
) → dynamic - Disposes ruut client and cancels all stream subscriptions
-
loadMessages(
) → void - Retrieves ruut client's messages. If persistence is enabled RuutCallbacks.onPersistedMessagesRetrieved will be triggered with persisted messages. On successfully fetch from remote server RuutCallbacks.onMessagesRetrieved will be triggered
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sendAction(
RuutActionType action) → Future< void> - Send ruut action performed by user.
-
sendAttachment(
{required File file}) → Future< void> -
sendMessage(
{required String content, required String echoId}) → Future< void> -
Sends ruut message. The echoId is your temporary message id. When message sends successfully
RuutMessage will be returned with the
echoIdon RuutCallbacks.onMessageSent. If message fails to send RuutCallbacks.onError will be triggeredechoIdas 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 ruut data on device.
-
clearData(
{required String baseUrl, required String inboxIdentifier, String? userIdentifier}) → Future< void> - Clears all persisted ruut data on device for a particular ruut client instance. See getClientInstanceKey on how ruut client instance are differentiated
-
create(
{required String baseUrl, required String inboxIdentifier, RuutUser? user, bool enablePersistence = true, RuutCallbacks? callbacks}) → Future< RuutClient> -
Creates an instance of RuutClient with the
baseUrlof your ruut installation,inboxIdentifierfor the targeted inbox. Specify custom user details usinguserandcallbacksfor handling ruut events. By default persistence is enabled, to disable persistence setenablePersistenceas false -
getClientInstanceKey(
{required String baseUrl, required String inboxIdentifier, String? userIdentifier}) → String - Create a ruut client instance key using the ruut client instance baseurl, inboxIdentifier and userIdentifier. Client instance keys are used to differentiate between client instances and their data (contact (RuutContact),conversation (RuutConversation) and messages (RuutMessage))