DartProject class Null safety

Class to resolve a Dart project directory.

Implementers
Available Extensions

Constructors

DartProject({Directory? directory, _Logger? logger, bool logToConsole = false})

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
projectDirectory FutureOr<Directory>
The resolved project Directory.
read-only
projectLibraryName FutureOr<String?>
The resolved project library name.
read-only
projectPackageConfigUri FutureOr<Uri>
The resolved project .dart_tool/package_config.json Uri.
read-only
projectPackageName FutureOr<String?>
The resolved project package name.
read-only
projectPubspec FutureOr<Map<String, dynamic>>
The resolved project pubspec.yaml Map.
read-only
projectPubspecFile FutureOr<File>
The resolved project pubspec.yaml file.
read-only
projectPubspecLock FutureOr<Map<String, dynamic>>
The resolved project pubspec.lock file as YamlMap.
read-only
projectPubspecLockFile FutureOr<File>
The resolved project pubspec.lock File.
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

cleanDartPubGetGeneratedFiles({required String confirmProjectName, bool verbose = false}) Future<bool>
Deletes files generated by dart pub get: [...]
ensureProjectDependenciesResolved() Future<bool>
Ensures that projectDirectory has the dependencies resolved. If not resolved runs dart pub get, calling runDartPubGet.
executablePath(String executableName, {bool refresh = false}) Future<String?>
Returns an executable binary path for executableName.
existsProjectPackageConfigUri() FutureOr<bool>
Returns true if projectPackageConfigUri exists.
getProjectDependencyVersion(String package) FutureOr<String?>
Returns the version string of package at the target project dependencies.
log(String type, dynamic message) → void
Logs a message.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
projectSubDirectory(String filePath) FutureOr<Directory>
Returns a sub-Directory inside projectDirectory.
projectSubFile(String filePath) FutureOr<File>
Returns a sub-File inside projectDirectory.
projectSubUri(String filePath) FutureOr<Uri>
Returns a sub-Uri inside projectDirectory.
runDartPubGet() Future<bool>
Runs dart pub get in the projectDirectory.
runDartVM(String entrypoint, List<String> args, {bool enableVMService = false, String? vmServiceAddress, int? vmServicePort, bool pauseIsolatesOnStart = false, bool pauseIsolatesOnExit = false, bool pauseIsolatesOnUnhandledExceptions = false, String? workingDirectory, bool handleSignals = false, bool redirectOutput = false, bool catchOutput = false, String stdoutFilter(String o)?, String stderrFilter(String o)?, void onSignal(ProcessSignal signal)?}) Future<ProcessInfo>
Runs a new Dart VM. [...]
runProcess(String commandName, List<String> args, {bool resolveCommandPath = true, String? workingDirectory, bool handleSignals = false, bool redirectOutput = false, bool catchOutput = false, String stdoutFilter(String o)?, String stderrFilter(String o)?, void onSignal(ProcessSignal signal)?}) Future<ProcessInfo>
Runs a Process command and returns it. [...]
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited

Static Methods

getFreeListenPort({Iterable<int>? ports, Iterable<int>? skipPort, int? startPort, int? endPort, bool shufflePorts = false, Duration? testTimeout}) Future<int?>
Returns a ServerSocket port free to listen. [...]
isFreeListenPort(int port, {Duration? testTimeout}) Future<bool>
Returns true if port is free to listen.