execute method Null safety

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

Implementation

List execute(List results, Map<String, dynamic> passed) {
  List total = [];
  FhirPathParser expression = value;
  if (value.value.first is CommaParser) {
    total.addAll((value.value.first as CommaParser)
        .after
        .execute(results.toList(), passed));
    expression = (value.value.first as CommaParser).before;
  }
  for (var r in results) {
    passed[r'$total'] = total.toList();
    total
      ..clear()
      ..addAll(expression.execute([r], passed));
  }
  return total;
}