clear method
Clears all keys and values from storage.
Implementation
@override
FutureOr<void> clear() async {
// Duck-typing support for shared_preferences getKeys and remove.
// ignore: avoid_dynamic_calls
final dynamic rawKeys = _prefs.getKeys();
if (rawKeys is Iterable) {
final keys = rawKeys.map((dynamic e) => e.toString()).toList();
for (final key in keys) {
if (prefix.isEmpty || key.startsWith(prefix)) {
// Duck-typing support for shared_preferences remove.
// ignore: avoid_dynamic_calls
await _prefs.remove(key);
}
}
}
}