createProjectStructure method

Future<void> createProjectStructure(
  1. ProjectDetails details
)

Implementation

Future<void> createProjectStructure(ProjectDetails details) async {
  final projectPath = p.join(Directory.current.path, details.name);
  final path = Structure.replaceAsExpected(path: projectPath);

  try {
    await Directory(path).create(recursive: true);
    Directory.current = path;

    await ShellUtils.flutterCreate(
        path, details.org, details.iosLang, details.androidLang);
    await File('test/widget_test.dart').writeAsString('');
  } catch (e) {
    print("Error creating project structure: $e");
    rethrow;
  }
}