onWidgetUrlTriggered static method

dynamic onWidgetUrlTriggered(
  1. Function handler
)

Implementation

static onWidgetUrlTriggered(Function handler) {
  _eventChannel.receiveBroadcastStream().listen((event) {
    final Map<dynamic, dynamic> eventData = event as Map<dynamic, dynamic>;
    final String? type = eventData['eventName'];
    final String? data = eventData['eventData'];
    if (type == _ON_WIDGET_URL_TRIGGERED) {
      handler(data);
    }
  });
}