create function

void create(
  1. String projectname
)

Implementation

void create(String projectname) async {
  final projectDir = Directory(projectname).absolute..createSync();
  copyFromGit(projectDir);
  final defaultpath = '${projectDir.path}/project_name';
  final newpath = '${projectDir.path}/$projectname';

  List<Future> futures = [
    Directory('${defaultpath}_flutter')
        .rename('${newpath}_flutter')
        .then((val) => reconfigureyaml(val, projectname)),
    Directory('${defaultpath}_server')
        .rename('${newpath}_server')
        .then((val) => reconfigureyaml(val, projectname)),
    Directory('${defaultpath}_generated')
        .rename('${newpath}_generated')
        .then((val) => reconfigureyaml(val, projectname))
  ];
  await Future.wait(futures);
  reconfigureDart(projectDir, projectname);
}