init static method

void init()

You need to initialize it as necessary, when the program starts for the first time.

Implementation

static void init() {
  _scannerPlugin ??= const EventChannel(channelName);
  _subscription = _scannerPlugin!.receiveBroadcastStream()
      .listen(_onEvent, onError: _onError);
}