chainFromList method

  1. @override
Callback1Arg<T> chainFromList(
  1. covariant List<Callback1Arg<T>?> callbacks
)
override

Returns a strongly-typed chained callback that calls through to the list of provided callbacks in order. Useful for executing multiple callbacks where only a single callback is accepted.

Returns false if one or more of the provided callbacks returns false.

Gracefully handles when callbacks is empty or its items are null, always returning a callable function.

Implementation

@override
Callback1Arg<T> chainFromList(List<Callback1Arg<T>?> callbacks) =>
    callbacks.fold(null, chain) ?? noop;