runDart method
Runs dart with arguments in workingDirectory, with output going to
the user. In project mode, pub uses the project cache unless
useProjectCache is false.
Implementation
Future<int> runDart(
List<String> arguments, {
String? workingDirectory,
bool useProjectCache = true,
Map<String, String> environment = const {},
}) {
console.detail('Running: dart ${arguments.join(' ')}');
return processRunner.runInteractive(
'dart',
arguments,
workingDirectory: workingDirectory ?? targetDirectory,
environment: {
if (useProjectCache) ...?project?.pubEnvironment,
...environment,
},
);
}