createIfMissing method

Future<File> createIfMissing({
  1. bool recursive = false,
  2. bool exclusive = false,
})

Creates the file if it does not exist. Returns the file instance.

Implementation

Future<File> createIfMissing(
    {bool recursive = false, bool exclusive = false}) async {
  if (!await exists()) {
    return await create(recursive: recursive, exclusive: exclusive);
  }
  return this;
}