getStructuredDataBySource method
Gets structured data by source
source
is the source of the data (e.g., the URL)
Implementation
Future<List<Map<String, dynamic>>> getStructuredDataBySource(
String source,
) async {
final ids = _cache.get(_structuredDataIdsKey) as List<dynamic>? ?? [];
final result = <Map<String, dynamic>>[];
for (final id in ids) {
final data =
_cache.get(_structuredDataKeyPrefix + id) as Map<String, dynamic>?;
if (data != null && data['source'] == source) {
result.add({
'id': data['id'],
'source': data['source'],
'timestamp': data['timestamp'],
'data': data['data'],
});
}
}
return result;
}