subscribeToWindowEvent method
void
subscribeToWindowEvent(
- String event,
- EventListener callback, {
- bool? useCapture,
- EventTarget? windowObject,
Adds an event listener to the window object and removes the event listener upon disposal.
If using this method, you cannot manually use the removeEventListener
method on the window singleton to remove the listener. At this point
the only way to remove the listener is to use the dispose method.
Implementation
void subscribeToWindowEvent(String event, EventListener callback,
{bool? useCapture, EventTarget? windowObject}) {
if (windowObject == null) {
windowObject = window;
}
_subscribeToEvent(windowObject, event, callback, useCapture);
}