ContactProviderImpl class

Inheritance

Constructors

ContactProviderImpl()

Properties

contactMap Map<String, ContactInfo?>
缓存的联系人列表
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
onContactInfoUpdated Stream<ContactInfo?>?
联系人信息变更通知,调用initListener之后不为空
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
subscriptions List<StreamSubscription>
final

Methods

cleanCache() → void
释放联系人缓存信息,在退出登录时调用
override
deleteFriend(String userId, {bool includeAlias = true}) Future<NIMResult<void>>
删除好友 userId 好友的accId includeAlias 是否同时删除好友备注
override
fetchContactList() Future<List<ContactInfo>>
获取所有的好友联系人信息 优先从缓存获取,失败则从SDK数据库本地获取,最后从服务端获取 包含FriendInfo
override
fetchUserList(List<String> accIdList) Future<List<ContactInfo>>
根据accIdList 批量获取用户信息 优先从缓存获取,失败则从服务端获取 不走数据库
override
getContact(String accId, {bool needRefresh = false, bool needFriend = true}) Future<ContactInfo?>
返回特定用户的信息 优先从缓存获取,失败则从SDK数据库本地获取,最后从服务端获取 如果needRefresh为true,则从服务端获取 如果needFriend为true,则获取好友信息
override
getContactCache() List<ContactInfo>
返回缓存的联系人列表,限好友
override
getContactInCache(String accId) ContactInfo?
返回缓存的联系人列表 返回contactMap中key为accId的值
override
initListener() → void
初始化联系人变化的监听,调用initListener之后才能使用onContactInfoUpdated
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeListeners() → void
释放监听,和initListener成对使用
override
toString() String
A string representation of this object.
inherited

Operators

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