spawnDartFile method

Future<SpawnedIsolate> spawnDartFile(
  1. File dartFile,
  2. List<String> args, {
  3. String? debugName,
  4. bool enableObservatory = false,
  5. bool runObservatory = false,
  6. bool usesSpawnedMain = false,
})

Spawn a Dart File.

A relative dartFile path is resolved against the current working directory (see File.absolute).

Implementation

Future<SpawnedIsolate> spawnDartFile(
  File dartFile,
  List<String> args, {
  String? debugName,
  bool enableObservatory = false,
  bool runObservatory = false,
  bool usesSpawnedMain = false,
}) => _spawnDart(
  dartFile,
  'File',
  // A relative `File.uri` would be resolved by `Isolate.spawnUri` against
  // the current isolate's script URI, not the working directory.
  dartFile.absolute.uri,
  args,
  debugName: debugName,
  enableObservatory: enableObservatory,
  runObservatory: runObservatory,
  usesSpawnedMain: usesSpawnedMain,
);