onceEvent<T extends Event> method

Future<T> onceEvent<T extends Event>([
  1. String? type
])

Same as onEvent but only running once, by returning a Future.

Implementation

Future<T> onceEvent<T extends Event>([String? type]) =>
    onEvent<T>(type).first;