clear method

Future<void> clear()

Clears all data from the cache.

Throws a CacheException if there is an error clearing the cache.

Implementation

Future<void> clear() async {
  try {
    await _cacheAdapter.clear();
    // Record clear operation in analytics
    _analytics.recordClear();
  } catch (e) {
    throw CacheException('Failed to clear cache: $e');
  }
}