addEvent method

void addEvent(
  1. String? id,
  2. String? type
)

Implementation

void addEvent(String? id, String? type) {
  if (!_listenMap.containsKey(id)) {
    // Init listener map
    _listenMap[id] = {};
  }

  // Mark event type listened
  var listeners = _listenMap[id]!;
  listeners[type] = true;
}