createFileIfNotExist function

File createFileIfNotExist(
  1. String filePath
)

Creates File in the given filePath if not exists

Implementation

File createFileIfNotExist(String filePath) {
  final file = File(path.joinAll(path.split(filePath)));
  if (!file.existsSync()) {
    file.createSync(recursive: true);
  }
  return file;
}