ensureDirExists function

Future<void> ensureDirExists(
  1. String dirPath
)

Implementation

Future<void> ensureDirExists(String dirPath) async {
  final dir = Directory(dirPath);
  if (!dir.existsSync()) {
    await dir.create(recursive: true);
  }
}