getAllForType method
Gets all stored values for a specific type, optionally filtered by key.
Implementation
@override
Future<Map<String, dynamic>> getAllForType(
String type, [
String? key,
]) async {
return _openLock.synchronized(() async {
final entry = _caches.entries.firstWhereOrNull((e) {
return e.value.type.toString() == type;
})?.value;
if (entry != null) {
try {
return await entry.getAll(key);
} catch (e) {
return {
'error': e.toString(),
};
}
}
return {
'result': 'No entries found for type $type',
};
});
}