createFolder function

void createFolder(
  1. String basePath,
  2. String relativePath
)

Creates a folder at the given path if it does not already exist.

Implementation

void createFolder(String basePath, String relativePath) {
  final dir = Directory('$basePath/$relativePath');
  if (!dir.existsSync()) {
    dir.createSync(recursive: true);
    print('📁 Created: ${dir.path}');
  } else {
    print('📂 Exists: ${dir.path}');
  }
}