executables property Null safety

List<Executable> executables

Get the list of exectuables

Implementation

List<Executable> get executables {
  if (_executables == null) {
    _executables = <Executable>[];
    for (final key in pubspec.executables.keys) {
      final String scriptPath;
      if (pubspec.executables[key]!.script == null) {
        scriptPath = join('bin', '$key.dart');
      } else {
        scriptPath = pubspec.executables[key]!.script!;
      }

      _executables!.add(Executable(key, scriptPath));
    }
  }

  return List.unmodifiable(_executables!);
}