clear method
Removes all values from the cache.
Returns true if cleared successfully
Implementation
@override
Future<bool> clear() async {
await _ensureInitialized();
// Remove all cache entries
final keysToRemove = _prefs!
.getKeys()
.where(
(key) =>
key.startsWith(_keyPrefix) || key.startsWith(_metadataPrefix),
)
.toList();
for (final key in keysToRemove) {
await _prefs!.remove(key);
}
// Clear in-memory cache
_metadataCache.clear();
return true;
}