off method

void off(
  1. EventListener listener
)

Remove event listener from emitter. This will unsubscribe the caller from the emitter from any future events. Listener should be a valid instance.

Implementation

void off(EventListener listener) {
  // Check if the listner has a valid callback for cancelling the subscription.
  // if (null != listener.cancel) {
  listener.cancel(); // Use the callback to cancel the subscription.
  // }
}