existsSync static method

bool existsSync(
  1. String uri, {
  2. bool isDir = false,
})

判断目录、文件是否存在

uri 资源路径 isDir 当前路径是否为文件夹

Implementation

static bool existsSync(
  String uri, {
  bool isDir = false,
}) {
  final type = FileSystemEntity.typeSync(uri);
  return type != FileSystemEntityType.notFound;
}