removeFromUserRtmMap function

void removeFromUserRtmMap({
  1. required String rtmId,
  2. required SessionController sessionController,
})

Implementation

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