type method Null safety

  1. @override
Future<FileSystemEntityType> type(
  1. String path,
  2. {bool followLinks = true}
)
override

Finds the type of file system object that a path points to. Returns a Future that completes with the result.

io.FileSystemEntityType.LINK will only be returned if followLinks is false, and path points to a link

If the path does not point to a file system object or an error occurs then io.FileSystemEntityType.NOT_FOUND is returned.

Implementation

@override
Future<FileSystemEntityType> type(String path, {bool followLinks = true}) {
  String realPath;
  try {
    realPath = _real(path, followLinks: followLinks);
  } on FileSystemException {
    return Future<FileSystemEntityType>.value(FileSystemEntityType.notFound);
  }
  return delegate.type(realPath, followLinks: false);
}