validate<T extends Event> method

bool validate<T extends Event>(
  1. T event
)

Checks if the listener matches a given event.

Implementation

bool validate<T extends Event>(T event) =>
    (event is CallbackDataT ||
        event.data is CallbackDataT ||
        isSubtype<T, CallbackDataT>() ||
        isSubtype<T, Event<CallbackDataT>>()) &&
    (event.type == type || type == null);