ChatContactManager class

The contact manager class, which manages chat contacts such as adding, deleting, retrieving, and modifying contacts.

Constructors

ChatContactManager()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

acceptInvitation(String userId) Future<void>
Accepts a friend invitation。
addContact(String userId, {String? reason}) Future<void>
Adds a new contact.
addEventHandler(String identifier, ChatContactEventHandler handler) → void
Adds the contact event handler. After calling this method, you can handle for new contact event when they arrive.
addUserToBlockList(String userId) Future<void>
Adds a user to the block list. You can send messages to the users on the block list, but cannot receive messages from them.
clearEventHandlers() → void
Clear all contact event handlers.
declineInvitation(String userId) Future<void>
Declines a friend invitation.
deleteContact(String userId, {bool keepConversation = false}) Future<void>
Deletes a contact and all the related conversations.
fetchAllContactIds() Future<List<String>>
Gets all the contact ids from the server.
fetchAllContacts() Future<List<ChatContact>>
Gets all contacts from the server.
fetchBlockIds() Future<List<String>>
Gets the block ids from the server.
fetchContacts({String? cursor, int pageSize = 20}) Future<ChatCursorResult<ChatContact>>
Gets the contact list from the server by page.
getAllContactIds() Future<List<String>>
Gets the contact ids from the local database.
getAllContacts() Future<List<ChatContact>>
Gets all contacts from the local database.
getAllContactsFromDB() Future<List<String>>
Gets the contact ids from the local database.
getAllContactsFromServer() Future<List<String>>
Gets all the contact ids from the server.
getBlockIds() Future<List<String>>
Gets the block ids from the local database.
getBlockListFromDB() Future<List<String>>
Gets the block list from the local database.
getBlockListFromServer() Future<List<String>>
Gets the block list from the server.
getContact({required String userId}) Future<ChatContact?>
Gets contact by userId.
getEventHandler(String identifier) ChatContactEventHandler?
Get the contact event handler.
getSelfIdsOnOtherPlatform() Future<List<String>>
Gets the unique IDs of the current user on the other devices. The ID is in the format of username + "/" + resource.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeEventHandler(String identifier) → void
Remove the contact event handler.
removeUserFromBlockList(String userId) Future<void>
Removes the contact from the block ids.
setContactRemark({required String userId, required String remark}) Future<void>
Set the contact's remark.
toString() String
A string representation of this object.
inherited

Operators

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