build<T> method

Step<T> build<T>(
  1. FutureOr<T> runStep(
    1. A valueA,
    2. B valueB,
    3. C valueC,
    4. D valueD,
    5. E valueE,
    6. F valueF,
    7. G valueG,
    8. H valueH,
    9. I valueI,
    10. List<S> values,
    )
)

Build a step with a single dependency.

This methods requires a runStep function which runs the step, given values from evaluation of dependent steps. The runStep method may be asynchronous. The runStep method will be invoked by Runner.run when the step is evaluated.

The dependent steps which creates valueA, valueB, ..., passed to runStep have already be defined when this object was created. See Step.define for how to define steps using this API.

This method returns the Step built by the builder.

Implementation

Step<T> build<T>(
  FutureOr<T> Function(
    A valueA,
    B valueB,
    C valueC,
    D valueD,
    E valueE,
    F valueF,
    G valueG,
    H valueH,
    I valueI,
    List<S> values,
  )
      runStep,
) {
  return Step._(_name, (r, wrap) async {
    final a_ = r.run(_a);
    final b_ = r.run(_b);
    final c_ = r.run(_c);
    final d_ = r.run(_d);
    final e_ = r.run(_e);
    final f_ = r.run(_f);
    final g_ = r.run(_g);
    final h_ = r.run(_h);
    final i_ = r.run(_i);
    final values_ = _dependencies.map(r.run).toList();
    await Future.wait([a_, b_, c_, d_, e_, f_, g_, h_, i_, ...values_]);
    final a = await a_;
    final b = await b_;
    final c = await c_;
    final d = await d_;
    final e = await e_;
    final f = await f_;
    final g = await g_;
    final h = await h_;
    final i = await i_;
    final values = await Future.wait(values_);
    return await wrap(() => runStep(a, b, c, d, e, f, g, h, i, values));
  }, [_a, _b, _c, _d, _e, _f, _g, _h, _i, ..._dependencies]);
}