addRequest method
Implementation
bool addRequest(String userId, String? reason, [bool isGroup = false]) {
List requestList = cachedMap[requestsKey] ?? [];
if (requestList.any((element) =>
element['id'] == userId && element['isGroup'] == isGroup)) {
return false;
}
requestList.add({
'id': userId,
'reason': reason,
'isGroup': isGroup,
'isRead': false,
});
cachedMap[requestsKey] = requestList;
ChatUIKit.instance.onFriendRequestCountChanged(newRequestCount());
_updateStore();
return true;
}