addListener method Null safety

Future addListener(
  1. void onData(
    1. dynamic event
    )?
)

Implementation

static Future addListener(void onData(dynamic event)?) async {
  await removeListener();
  deeplinkUtilsSubscription = _eventChannel.receiveBroadcastStream().listen(onData);
}