chainFromList method

  1. @override
Callback0Arg chainFromList(
  1. covariant List<Callback0Arg?> 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
Callback0Arg chainFromList(List<Callback0Arg?> callbacks) =>
    callbacks.fold(null, chain) ?? noop;