removeRequests method
void
removeRequests(
- List<String> userIds, [
- dynamic isGroup = false
])
Implementation
void removeRequests(List<String> userIds, [isGroup = false]) {
List requestList = cachedMap[requestsKey] ?? [];
bool needUpdate = false;
for (var userId in userIds) {
int index = requestList.indexWhere((element) =>
element['id'] == userId && element['isGroup'] == isGroup);
if (index != -1) {
needUpdate = true;
requestList.removeAt(index);
}
}
if (needUpdate) {
cachedMap[requestsKey] = requestList;
_updateStore();
ChatUIKit.instance.onFriendRequestCountChanged(newRequestCount());
}
}