createFolder static method

Future<void> createFolder(
  1. String folderPath
)



Implementation

static Future<void> createFolder(String folderPath) async {
  try {
    final dir = Directory(folderPath);

    if (await dir.exists()) {
      print('📂 Folder already exists: $folderPath');
    } else {
      await dir.create(recursive: true);
      print('📁 Folder created: $folderPath');
    }
  } catch (e) {
    print('❌ Error creating folder: $e');
  }
}