existsAsync static method

Future<bool> existsAsync(
  1. String uri, {
  2. bool isDir = false,
})

判断目录、文件是否存在

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

Implementation

static Future<bool> existsAsync(
  String uri, {
  bool isDir = false,
}) async {
  final type = await FileSystemEntity.type(uri);
  return type != FileSystemEntityType.notFound;
}