addEventListener method

void addEventListener(
  1. String type,
  2. void listener(
    1. dynamic
    )
)

Add a new event listener to the device.

Marking the method with JSUtils.allowInterop will be done automatically for you.

Events to be handled are:

  • oncharacteristicvaluechanged

See:

Implementation

void addEventListener(
    final String type, final void Function(dynamic) listener) {
  _JSUtil.callMethod(
      _jsObject, "addEventListener", [type, _JSUtil.allowInterop(listener)]);
}