listener static method

void listener(
  1. Function eventHandle, {
  2. Function? error,
})

Implementation

static void listener(Function eventHandle, {Function? error}) {
  _subscription = _eventChannel.receiveBroadcastStream().listen(eventHandle as void Function(dynamic)?,
      onError: error ??
          (Object error) {
            print(error.toString());
          });
}