getFile method

Future<File?> getFile({
  1. String? fileName,
  2. String? path,
})

Returns the file handle, or null when the file does not exist.

Implementation

Future<File?> getFile({String? fileName, String? path}) async {
  final String resolved = await _resolvePath(fileName, path);
  final File file = File(resolved);
  return file.existsSync() ? file : null;
}