execute method Null safety

List execute(
  1. List results,
  2. Map<String, dynamic> passed
)
override

Implementation

List execute(List results, Map<String, dynamic> passed) {
  var finalResults = [];
  results.forEach((r) {
    value.execute([r], passed).forEach((e) {
      if (notFoundInList(finalResults, e)) {
        finalResults.add(e);
      }
    });
  });
  var len = -1;
  while (len != finalResults.length) {
    results = finalResults.toList();
    len = finalResults.length;
    results.forEach((r) {
      value.execute([r], passed).forEach((e) {
        if (notFoundInList(finalResults, e)) {
          finalResults.add(e);
        }
      });
    });
  }
  return finalResults;
}