EventHandler<TEvent>.function constructor

const EventHandler<TEvent>.function(
  1. FutureOr<void> handler(
    1. TEvent event
    )
)

Function based EventHandler.

Each event the underlying handler will be executed.

Implementation

const factory EventHandler.function(
  FutureOr<void> Function(TEvent event) handler,
) = _FunctionEventHandler;