removeFromUidToUserMap function

void removeFromUidToUserMap({
  1. required int rtcId,
  2. required SessionController sessionController,
})

Implementation

void removeFromUidToUserMap({
  required int rtcId,
  required SessionController sessionController,
}) {
  Map<int, String> tempMap = {};
  tempMap = sessionController.value.uidToUserIdMap!;
  for (int i = 0; i < tempMap.length; i++) {
    if (tempMap.keys.elementAt(i) == rtcId) {
      tempMap.remove(rtcId);
    }
  }
  sessionController.value =
      sessionController.value.copyWith(uidToUserIdMap: tempMap);
}