removeListener method

void removeListener(
  1. MpnDeviceListener listener
)

Removes a listener from the MPN device object so that it will not receive events anymore.

Lifecycle A listener can be removed at any time.

Implementation

void removeListener(MpnDeviceListener listener) {
  var found = _listeners.remove(listener);
  if (found) {
    scheduleMicrotask(() {
      listener.onListenEnd();
    });
  }
}