DartSpawner class Null safety

Class capable to spawn a Dart script/File/Uri into an Isolate.

Inheritance
Available Extensions

Constructors

DartSpawner({Directory? directory, _Logger? logger, bool logToConsole = false, Duration? startupTimeout})
Constructs a new DartSpawner. [...]

Properties

exitCode Completer<int>
The exit code of the spawned Dart script/file.
final
hashCode int
The hash code for this object. [...]
read-only, inherited
id int
final
isFinished bool
Returns true if the spawned Dart script/file have finished.
read-only
isolateCheckPingTimeout Duration
The timeout of a Isolate check (calling Isolate.ping).
final
isSpawned bool
Returns true if this instance already have spawned a script.
read-only
projectDirectory FutureOr<Directory>
The resolved project Directory.
read-only, inherited
projectLibraryName FutureOr<String?>
The resolved project library name.
read-only, inherited
projectPackageConfigUri FutureOr<Uri>
The resolved project .dart_tool/package_config.json Uri.
read-only, inherited
projectPackageName FutureOr<String?>
The resolved project package name.
read-only, inherited
projectPubspec FutureOr<Map<String, dynamic>>
The resolved project pubspec.yaml Map.
read-only, inherited
projectPubspecFile FutureOr<File>
The resolved project pubspec.yaml file.
read-only, inherited
projectPubspecLock FutureOr<Map<String, dynamic>>
The resolved project pubspec.lock file as YamlMap.
read-only, inherited
projectPubspecLockFile FutureOr<File>
The resolved project pubspec.lock File.
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
spawnedEntry Object?
The spawned Dart entry.
read / write
spawnedType String?
The spawned type.
read / write
startupTimeout Duration
The timeout to identify the Isolate startup.
final

Methods

cleanDartPubGetGeneratedFiles({required String confirmProjectName, bool verbose = false}) Future<bool>
Deletes files generated by dart pub get: [...]
inherited
ensureProjectDependenciesResolved() Future<bool>
Ensures that projectDirectory has the dependencies resolved. If not resolved runs dart pub get, calling runDartPubGet.
inherited
executablePath(String executableName, {bool refresh = false}) Future<String?>
Returns an executable binary path for executableName.
inherited
existsProjectPackageConfigUri() FutureOr<bool>
Returns true if projectPackageConfigUri exists.
inherited
getProjectDependencyVersion(String package) FutureOr<String?>
Returns the version string of package at the target project dependencies.
inherited
isDartFilePath(dynamic dartEntryPoint) bool
Returns true if dartEntryPoint is a String and a File path with a '.dart' extension.
launchObservatory(String url) Future<ProcessResult>
Launches the observatory url.
log(String type, dynamic message) → void
Logs a message.
inherited
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.
inherited
projectSubFile(String filePath) FutureOr<File>
Returns a sub-File inside projectDirectory.
inherited
projectSubUri(String filePath) FutureOr<Uri>
Returns a sub-Uri inside projectDirectory.
inherited
runDartPubGet() Future<bool>
Runs dart pub get in the projectDirectory.
inherited
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. [...]
inherited
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. [...]
inherited
spawnDart(dynamic dartEntryPoint, List<String> args, {String? debugName, bool enableObservatory = false, bool runObservatory = false, bool usesSpawnedMain = false}) Future<SpawnedIsolate>
Spawn a Dart entry point (script, File or Uri).
spawnDartFile(File dartFile, List<String> args, {String? debugName, bool enableObservatory = false, bool runObservatory = false, bool usesSpawnedMain = false}) Future<SpawnedIsolate>
Spawn a Dart File.
spawnDartScript(String dartScript, List<String> args, {String? debugName, bool enableObservatory = false, bool runObservatory = false, bool usesSpawnedMain = false}) Future<SpawnedIsolate>
Spawn a Dart script.
spawnDartURI(Uri dartUri, List<String> args, {String? debugName, bool enableObservatory = false, bool runObservatory = false, bool usesSpawnedMain = false}) Future<SpawnedIsolate>
Spawn a Dart Uri.
supportsLaunchObservatory() Future<bool>
Returns true if this environment supports observatory launch.
toString() String
A string representation of this object. [...]
override

Operators

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

Static Properties

filePathReservedChars RegExp
final