clearCache static method

Future<void> clearCache()

清除缓存。

Implementation

static Future<void> clearCache() async {
  final Directory appDocDir = await getTemporaryDirectory();
  if (appDocDir.existsSync()) {
    await deleteDirectory(appDocDir);
  } else {
    debugPrint('Cache directory does not exist');
  }
}