logBridgeEvent function
Forwards event to onBridgeAnalyticsEvent when a sink is registered;
otherwise a safe no-op. Never throws — analytics must never break the flow.
Implementation
void logBridgeEvent(Map<String, dynamic> event) {
final sink = onBridgeAnalyticsEvent;
if (sink == null) return;
try {
sink(event);
} catch (_) {
// Swallow: a misbehaving analytics sink must not affect the WebView.
}
}