SquadweClient class FlutterClientSdk
Represents a squadwe client instance. All squadwe operations (Example: sendMessages) are passed through squadwe client. For more info visit https://www.squadwe.com/docs/product/channels/api/client-apis
Properties
- baseUrl → String
-
no setter
- callbacks → SquadweCallbacks?
-
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 → SquadweUser?
-
final
Methods
-
clearClientData(
) → dynamic - Clears all squadwe client data
-
dispose(
) → dynamic - Disposes squadwe client and cancels all stream subscriptions
-
loadMessages(
) → void - Retrieves squadwe client's messages. If persistence is enabled SquadweCallbacks.onPersistedMessagesRetrieved will be triggered with persisted messages. On successfully fetch from remote server SquadweCallbacks.onMessagesRetrieved will be triggered
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sendAction(
SquadweActionType action) → Future< void> - Send squadwe action performed by user.
-
sendMessage(
{required String content, required String echoId}) → Future< void> -
Sends squadwe message. The echoId is your temporary message id. When message sends successfully
SquadweMessage will be returned with the
echoId
on SquadweCallbacks.onMessageSent. If message fails to send SquadweCallbacks.onError will be triggeredechoId
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 squadwe data on device.
-
clearData(
{required String baseUrl, required String inboxIdentifier, String? userIdentifier}) → Future< void> - Clears all persisted squadwe data on device for a particular squadwe client instance. See getClientInstanceKey on how squadwe client instance are differentiated
-
create(
{required String baseUrl, required String inboxIdentifier, SquadweUser? user, bool enablePersistence = true, SquadweCallbacks? callbacks}) → Future< SquadweClient> -
Creates an instance of SquadweClient with the
baseUrl
of your squadwe installation,inboxIdentifier
for the targeted inbox. Specify custom user details usinguser
andcallbacks
for handling squadwe events. By default persistence is enabled, to disable persistence setenablePersistence
as false -
getClientInstanceKey(
{required String baseUrl, required String inboxIdentifier, String? userIdentifier}) → String - Create a squadwe client instance key using the squadwe client instance baseurl, inboxIdentifier and userIdentifier. Client instance keys are used to differentiate between client instances and their data (contact (SquadweContact),conversation (SquadweConversation) and messages (SquadweMessage))