find method
get all documents that match query
with optional change-listener
Implementation
Future<List<T>> find(
[Map<dynamic, dynamic> query = const {}, ListenerCallback? listener]) {
try {
if (listener != null) {
_listeners.add(Listener(query, listener));
}
return _executionQueue.add<List<T>>(() async =>
await (await _storage.find(query)).map<T>(createItem).toList());
} catch (e) {
rethrow;
}
}