addEvent method

bool addEvent(
  1. int instanceId,
  2. int nodeId,
  3. String eventName
)

Implementation

bool addEvent(int instanceId, int nodeId, String eventName) {
  bool addSuccess = false;
  var instanceMap = _instanceEventMap[instanceId];
  if (instanceMap != null) {
    var nodeEventSet = instanceMap[nodeId]??<String>{};
    if (!nodeEventSet.contains(eventName)) {
      nodeEventSet.add(eventName);
      addSuccess = true;
    }
    instanceMap[nodeId] = nodeEventSet;
  }
  return addSuccess;
}