matches<T> method

bool matches<T>([
  1. String? type,
  2. EventCallback<T>? callback
])

Checks if the listener matches the event type, data type and callback.

Implementation

bool matches<T>([String? type, EventCallback<T>? callback]) =>
    (isSubtype<CallbackDataT, T>() || isSubtype<Event<CallbackDataT>, T>()) &&
    (this.type == type || this.type == null || type == null) &&
    (this.callback == callback || callback == null);