createWorkspaceFolderSync method

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

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

Parameters:

  • projectName: 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

void createWorkspaceFolderSync({required String projectName}) {
  log('📁 Creating workspace folder...');
  final folderName = '${projectName}_workspaces';
  final dir = fs.directory(folderName);
  dir.createSync(recursive: true);
  fs.currentDirectory = dir;
  log('✅ Workspace folder created: $folderName');
}