initFolders method
Future<void>
initFolders(
{ - bool setUpPackage = false,
})
Implementation
Future<void> initFolders({bool setUpPackage = false}) async {
try {
final appInfo = await _getUserApplicationData();
final repoUrl =
"https://github.com/abdAlftahSalem/flutter_getx_template.git";
final dirName = appInfo['appName'] ?? "";
print(
"\n\nšš Thunder will initialize your app. Please wait for seconds");
final cloneExitCode = await _cloneRepository(repoUrl, dirName);
if (cloneExitCode == 0) {
final success = await _setupClonedProject(appInfo);
if (success) {
print('ā” Init app successfully\n');
await _publishToGitHub();
final openInVSCode = await _askToOpenInVSCode();
if (openInVSCode) {
print('ā” Opening project in VSCode...');
await _openInVSCode();
}
} else {
print('š
An error occurred during project setup.');
}
} else {
print('š
Failed to clone the repository.');
}
} catch (e) {
print('š
An error occurred: $e');
}
}