removeAllComponentEvents function Null safety

void removeAllComponentEvents()

Removes all currently attached componen evens

Implementation

void removeAllComponentEvents() {
  var toRemove = List<String>.empty(growable: true);
  eventSubscriptions.forEach((k, v) => toRemove.add(k));
  for (int i = 0; i < toRemove.length; i++) {
    eventSubscriptions.remove(toRemove[i]);
  }
}