getDrivers method Null safety

  1. @override
List<Logic> getDrivers()
override

Lists all drivers, recursively including all sub-Conditionals drivers.

Implementation

@override
List<Logic> getDrivers() {
  final allDrivers = <Logic>[condition];
  for (final element in then) {
    allDrivers.addAll(element.getDrivers());
  }
  for (final element in orElse) {
    allDrivers.addAll(element.getDrivers());
  }
  return allDrivers;
}