createView function

Future createView(
  1. String fileName,
  2. bool force
)

Implementation

Future createView(String fileName, bool force) async {
  const String path = "lib/presentation/views/";
  await createDirectory(
      DirectoryModel(
        name: fileName,
        path: path,
      ),
      force: force);
  createFile(
    FileModel(
        content: _getFileContent(fileName),
        name: '${fileName}_screen.dart',
    ),
    "$path$fileName/",
  );
  await createDirectory(DirectoryModel(name: "widgets", path: '$path$fileName/'));

  await _addToRoutes(fileName);
}