asFile function

File asFile(
  1. FileSystemEntity file
)

convert to a file object if necessary

Implementation

File asFile(FileSystemEntity file) {
  if (file is File) {
    return file;
  } else {
    return file.fs.file(file.path);
  }
}