createWorkspaceFolderSync static method

void createWorkspaceFolderSync({
  1. required String projectName,
})

Creates <name>_workspaces and changes the current working directory.

Parameters:

  • name: base name for the workspace (e.g. my_app). The folder created will be my_app_workspaces and Directory.current will be set to it.

Implementation

static void createWorkspaceFolderSync({required String projectName}) {
  print('📁 Creating workspace folder...');
  final folderName = '${projectName}_workspaces';
  final dir = Directory(folderName);
  dir.createSync(recursive: true);
  Directory.current = dir.absolute.path;
  print('✅ Workspace folder created: $folderName');
}