onWindowEvent method
Subscribe to events for a specific window.
Implementation
void onWindowEvent(
String windowId,
String eventName,
void Function(NativeEvent) callback,
) {
void handler(NativeEvent event) {
if (event.event == eventName && event.windowId == windowId) {
callback(event);
}
}
_subscriptions.add(handler);
_bridge.subscribe(serviceName, handler);
}