execute static method
Executes commands in multiple Flutter project directories concurrently.
This method finds all Flutter project directories (those containing pubspec.yaml) and executes the specified commands in each directory concurrently.
Parameters:
commands: List of commands to execute in each directoryconcurrent: Number of concurrent executions (default: 6)customCommand: Optional custom command to execute after main commandsstdout: Callback for stdout linesstdoutErr: Callback for stderr linesignorePubWorkspaces: Whether to ignore pub workspaces (default: false)
Example:
// Run 'flutter pub get' in all Flutter project directories
await ModularHelper.execute(['flutter pub get']);
Implementation
static Future<void> execute(
List<String> commands, {
int concurrent = defaultConcurrent,
void Function(String)? customCommand,
void Function(String line)? stdout,
void Function(String line)? stdoutErr,
bool ignorePubWorkspaces = false,
}) async {
await _executeConcurrentCommands(
commands,
concurrent: concurrent,
customCommand: customCommand,
stdout: stdout,
stdoutErr: stdoutErr,
ignorePubWorkspaces: ignorePubWorkspaces,
);
}