moveConfigsToWorkspaceRootSync static method
void
moveConfigsToWorkspaceRootSync({})
Moves configuration files from the Flutter app folder to the workspace root.
Moves .gitignore and analysis_options.yaml so they apply globally.
Parameters:
projectName: the name of the Flutter app folder. Throws:- Exception with message
⚠️ Failed to move configuration fileson failure.
Implementation
static void moveConfigsToWorkspaceRootSync({
required String projectName,
required Directory initialDirectory,
}) {
print('🚚 Moving configuration files to workspace root...');
final files = ['.gitignore', 'analysis_options.yaml'];
for (final fileName in files) {
try {
final source = File('$projectName/$fileName');
if (source.existsSync()) {
source.renameSync(fileName);
print('✅ Moved $fileName to workspace root');
}
} catch (_) {
throw Exception('⚠️ Failed to move $fileName');
}
}
}