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.length == 1 && before.first is IdentifierParser
          ? [(before.first as IdentifierParser).value]
          : before.execute(results.toList(), passed);
  final executedAfter = after.length == 1 && after.first is IdentifierParser
      ? [(after.first as IdentifierParser).value]
      : after.execute(results.toList(), passed);
  if (executedBefore.isEmpty || executedAfter.isEmpty) {
    return [];
  } else {
    for (var i = 0; i < executedBefore.length; i++) {
      if ((executedBefore[i] is String ||
                  executedBefore[i] is bool ||
                  executedBefore[i] is num
              ? executedBefore[i]
              : executedBefore[i].value) ==
          (executedAfter[i] is String ||
                  executedAfter[i] is bool ||
                  executedAfter[i] is num
              ? executedAfter[i]
              : executedAfter[i].value)) {
        return [false];
      }
    }
    return [true];
  }
}