asFile property

File? get asFile

Return a File if the string is a file path, otherwise return null.

Implementation

File? get asFile {
  if (FileSystemEntity.isFileSync(this)) {
    return File(this);
  }
  return null;
}