spawnDartProcess function
Spawns a Dart process using the current Dart executable.
By default, stdio is inherited to make the child process feel "attached".
Implementation
Future<Process> spawnDartProcess(
List<String> args, {
Map<String, String>? environment,
String? workingDirectory,
bool inheritStdio = true,
}) async {
final process = await startDartProcess(
args,
workingDirectory: workingDirectory,
environment: environment,
mode: inheritStdio
? ProcessStartMode.inheritStdio
: ProcessStartMode.normal,
);
return process;
}