run method

String run(
  1. String package, {
  2. List<String>? arguments,
  3. RunOptions? runOptions,
  4. String? script,
  5. String? workingDirectory,
})

Run the given installed Dart application.

Implementation

String run(String package,
    {List<String>? arguments,
    RunOptions? runOptions,
    String? script,
    String? workingDirectory}) {
  runOptions = mergeWorkingDirectory(workingDirectory, runOptions);
  var scriptArg = script == null ? package : '$package:$script';
  final args = ['pub', 'global', 'run', scriptArg];
  if (arguments != null) args.addAll(arguments);
  return runlib.run(sdkBin('dart'), arguments: args, runOptions: runOptions);
}