once method

AsyncEventEmitter once(
  1. String event,
  2. Handler listener
)

Adds a listener that is only called on the first event.

Implementation

AsyncEventEmitter once(String event, Handler<dynamic> listener) {
  final wrappedListener = _createOnceListener(event, listener);
  return addListener(event, wrappedListener);
}