off method

void off(
  1. String topic,
  2. Function? callback
)

Remove a specific callback from a topic's subscription list in the event system. If the function is in the list, removes it from the subscription and one-time subscription lists.

Implementation

void off(String topic, Function? callback) {
  _cache[topic]?.remove(callback);
  _cacheOnce[topic]?.remove(callback);
}