once static method

dynamic once(
  1. String event, {
  2. dynamic data,
})

Implementation

static once(String event, {data}) {
  final callList = _eventMap[event];

  if (callList != null) {
    for (final item in new List.from(callList, growable: false)) {
      removeListener(item);

      _errorWrap(event, item, data);
    }
  }
}