map static method

dynamic map(
  1. List ary,
  2. dynamic each(
    1. dynamic _,
    2. dynamic callback(
      1. dynamic msg
      )
    ),
  3. dynamic done(
    1. dynamic results
    )
)

Implementation

static map(List ary, Function(dynamic _, Function(dynamic msg) callback) each,
    Function(dynamic results) done) {
  var result = [];
  Future.wait(ary.map((e) {
    return Future.microtask(() => each(e, (msg) {
          result.add(msg);
        }));
  })).then((r) => done(result));
}