execute method Null safety

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

Implementation

List execute(List results, Map<String, dynamic> passed) {
  final executedBefore = before.execute(results.toList(), passed);
  final executedAfter = after.execute(results.toList(), passed);
  if (executedBefore.isEmpty || executedAfter.isEmpty) {
    return [];
  } else if (executedBefore.length != executedAfter.length) {
    return [false];
  } else {
    for (var i = 0; i < executedBefore.length; i++) {
      if ((executedBefore[i] != executedAfter[i] &&
          executedAfter[i] != executedBefore[i])) {
        return [false];
      }
    }
    return [true];
  }
}