StreamChatPersistenceClient class

A DriftChatDatabase based implementation of the ChatPersistenceClient

Constructors

StreamChatPersistenceClient({ConnectionMode connectionMode = ConnectionMode.regular, Level logLevel = Level.WARNING, bool webUseExperimentalIndexedDb = false, LogHandlerFunction? logHandlerFunction})
Creates a new instance of the stream chat persistence client

Properties

db ↔ DriftChatDatabase?
DriftChatDatabase instance used by this client.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
isConnected bool
Whether the connection is established.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
userId String?
The current user id to which the client is connected.
no setter

Methods

bulkUpdateMembers(Map<String, List<Member>?> members) Future<void>
Bulk updates the members data of multiple channels.
bulkUpdateMessages(Map<String, List<Message>?> messages) Future<void>
Bulk updates the message data of multiple channels.
bulkUpdatePinnedMessages(Map<String, List<Message>?> messages) Future<void>
Bulk updates the message data of multiple channels.
bulkUpdateReads(Map<String, List<Read>?> reads) Future<void>
Bulk updates the read data of multiple channels.
connect(String userId, {DatabaseProvider? databaseProvider}) Future<void>
Creates a new connection to the client
deleteChannels(List<String> cids) Future<void>
Remove a channel by channelId
deleteMembersByCids(List<String> cids) Future<void>
Deletes all the members by channel cids
deleteMessageByCid(String cid) Future<void>
Remove a message by channel cid
inherited
deleteMessageByCids(List<String> cids) Future<void>
Remove a message by message cids
deleteMessageById(String messageId) Future<void>
Remove a message by messageId
inherited
deleteMessageByIds(List<String> messageIds) Future<void>
Remove a message by messageIds
deletePinnedMessageByCid(String cid) Future<void>
Remove a pinned message by channel cid
inherited
deletePinnedMessageByCids(List<String> cids) Future<void>
Remove a pinned message by message cids
deletePinnedMessageById(String messageId) Future<void>
Remove a pinned message by messageId
inherited
deletePinnedMessageByIds(List<String> messageIds) Future<void>
Remove a pinned message by messageIds
deletePinnedMessageReactionsByMessageId(List<String> messageIds) Future<void>
Deletes all the pinned messages reactions by messageIds
deleteReactionsByMessageId(List<String> messageIds) Future<void>
Deletes all the reactions by messageIds
disconnect({bool flush = false}) Future<void>
Closes the client connection If flush is true, the data will also be deleted
getChannelByCid(String cid) Future<ChannelModel?>
Get stored ChannelModels by providing channel cid
getChannelCids() Future<List<String>>
Get the channel cids saved in the offline storage
getChannelStateByCid(String cid, {PaginationParams? messagePagination, PaginationParams? pinnedMessagePagination}) Future<ChannelState>
Get ChannelState data by providing channel cid
inherited
getChannelStates({Filter? filter, List<SortOption<ChannelState>>? channelStateSort, PaginationParams? paginationParams}) Future<List<ChannelState>>
Get all the stored ChannelStates
getChannelThreads(String cid) Future<Map<String, List<Message>>>
Returns all the threads by parent message of a particular channel by providing channel cid
getConnectionInfo() Future<Event?>
Get stored connection event
getLastSyncAt() Future<DateTime?>
Get stored lastSyncAt
getMembersByCid(String cid) Future<List<Member>>
Get stored channel Members by providing channel cid
getMessagesByCid(String cid, {PaginationParams? messagePagination}) Future<List<Message>>
Get stored Messages by providing channel cid
getPinnedMessagesByCid(String cid, {PaginationParams? messagePagination}) Future<List<Message>>
Get stored pinned Messages by providing channel cid
getReadsByCid(String cid) Future<List<Read>>
Get stored channel Reads by providing channel cid
getReplies(String parentId, {PaginationParams? options}) Future<List<Message>>
Get stored replies by messageId
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
updateChannelQueries(Filter? filter, List<String> cids, {bool clearQueryCache = false}) Future<void>
Update list of channel queries.
updateChannels(List<ChannelModel> channels) Future<void>
Updates all the channels using the new channels data.
updateChannelState(ChannelState channelState) Future<void>
Update the channel state data using channelState
inherited
updateChannelStates(List<ChannelState> channelStates) Future<void>
Update list of channel states
updateChannelThreads(String cid, Map<String, List<Message>> threads) Future<void>
Updates the channel cid threads data along with reactions and users.
updateConnectionInfo(Event event) Future<void>
Update stored connection event
updateLastSyncAt(DateTime lastSyncAt) Future<void>
Update stored lastSyncAt
updateMembers(String cid, List<Member> members) Future<void>
Updates all the members of a particular channle cid with the new members data
inherited
updateMessages(String cid, List<Message> messages) Future<void>
Updates the message data of a particular channel cid with the new messages data
inherited
updatePinnedMessageReactions(List<Reaction> reactions) Future<void>
Updates the pinned message reactions data with the new reactions data
updatePinnedMessages(String cid, List<Message> messages) Future<void>
Updates the pinned message data of a particular channel cid with the new messages data
inherited
updateReactions(List<Reaction> reactions) Future<void>
Updates the reactions data with the new reactions data
updateReads(String cid, List<Read> reads) Future<void>
Updates the read data of a particular channel cid with the new reads data
inherited
updateUsers(List<User> users) Future<void>
Updates the users data with the new users data

Operators

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