ChatContactManager class

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

~chinese 联系人管理类,用于记录、查询和修改用户的联系人列表。 ~end

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>
~english Accepts a friend invitation。
addContact(String userId, {String? reason}) Future<void>
~english Adds a new contact.
addEventHandler(String identifier, ChatContactEventHandler handler) → void
~english Adds the contact event handler. After calling this method, you can handle for new contact event when they arrive.
addUserToBlockList(String userId) Future<void>
~english 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
~english Clear all contact event handlers. ~end
declineInvitation(String userId) Future<void>
~english Declines a friend invitation.
deleteContact(String userId, {bool keepConversation = false}) Future<void>
~english Deletes a contact and all the related conversations.
fetchAllContactIds() Future<List<String>>
~english Gets all the contact ids from the server.
fetchAllContacts() Future<List<ChatContact>>
~english Gets all contacts from the server.
fetchBlockIds() Future<List<String>>
~english Gets the block ids from the server.
fetchContacts({String? cursor, int pageSize = 20}) Future<ChatCursorResult<ChatContact>>
~english Gets the contact list from the server by page.
getAllContactIds() Future<List<String>>
~english Gets the contact ids from the local database.
getAllContacts() Future<List<ChatContact>>
~english Gets all contacts from the local database.
getAllContactsFromDB() Future<List<String>>
~english Gets the contact ids from the local database.
getAllContactsFromServer() Future<List<String>>
~english Gets all the contact ids from the server.
getBlockIds() Future<List<String>>
~english Gets the block ids from the local database.
getBlockListFromDB() Future<List<String>>
~english Gets the block list from the local database.
getBlockListFromServer() Future<List<String>>
~english Gets the block list from the server.
getContact({required String userId}) Future<ChatContact?>
~english Gets contact by userId.
getEventHandler(String identifier) ChatContactEventHandler?
~english Get the contact event handler.
getSelfIdsOnOtherPlatform() Future<List<String>>
~english 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
~english Remove the contact event handler.
removeUserFromBlockList(String userId) Future<void>
~english Removes the contact from the block ids.
setContactRemark({required String userId, required String remark}) Future<void>
~english Set the contact's remark.
toString() String
A string representation of this object.
inherited

Operators

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