createFlutterAppSync static method
Scaffolds a new Flutter app by running flutter create <projectName>.
Parameters:
projectName: the folder/name of the Flutter application to create.
Throws:
- Exception when the
flutter createcommand fails.
Implementation
static void createFlutterAppSync({required String projectName}) {
try {
print('📱 Creating Flutter app...');
Process.runSync(
'flutter',
['create', projectName],
workingDirectory: Directory.current.path,
runInShell: true,
);
print('✅ Flutter app created: $projectName');
} catch (_) {
throw Exception('Failed to create Flutter app');
}
}