getCacheDirectory static method

Future<Directory> getCacheDirectory()

Implementation

static Future<Directory> getCacheDirectory() async {
  if (_cacheDirectory != null) {
    return _cacheDirectory!;
  }

  final String appTemporaryPath = await getWebFTemporaryPath();
  final Directory cacheDirectory =
      Directory(path.join(appTemporaryPath, 'ByteCodeCaches'));
  bool isThere = await cacheDirectory.exists();
  if (!isThere) {
    await cacheDirectory.create(recursive: true);
  }
  return _cacheDirectory = cacheDirectory;
}