createDirectoryWithFile function

bool createDirectoryWithFile(
  1. String dirPath,
  2. String fileName,
  3. String content
)

Creates dirPath then writes a file named fileName inside it with the given content.

Returns true if the file was created, or false if it already existed.

Implementation

bool createDirectoryWithFile(String dirPath, String fileName, String content) {
  createDirectory(dirPath);
  return createFile('$dirPath/$fileName', content);
}