removeRequest method

void removeRequest(
  1. String userId, [
  2. bool isGroup = false
])

Implementation

void removeRequest(String userId, [bool isGroup = false]) {
  List requestList = cachedMap[requestsKey] ?? [];
  int index = requestList.indexWhere(
      (element) => element['id'] == userId && element['isGroup'] == isGroup);
  if (index != -1) {
    Map ret = requestList.removeAt(index);
    if (ret.containsKey('isRead') && !ret['isRead']) {
      ChatUIKit.instance.onFriendRequestCountChanged(newRequestCount());
    }
    cachedMap[requestsKey] = requestList;
    _updateStore();
  }
}