isAnimCached method

Future<bool> isAnimCached({
  1. required String anim,
  2. String? dir,
})

动画是否已缓存 anim 动画相对地址 dir 动画存储地址,不传默认使用getAnimCacheDir的地址

Implementation

Future<bool> isAnimCached({required String anim, String? dir}) async {
  try {
    final cacheDir = dir ?? getAnimCacheDir();
    String cachePath = "$cacheDir$anim";
    File cacheFile = File(cachePath);
    return await cacheFile.exists();
  } catch (e) {
    return Future.value(false);
  }
}