updateCollectionWhere<T> static method
Update item(s) in a collection using a where query.
Implementation
static Future updateCollectionWhere<T>(bool Function(dynamic value) where,
{required String key, required T Function(dynamic value) update}) async {
List<T> collection = await readCollection<T>(key);
if (collection.isEmpty) return;
collection.where((value) => where(value)).forEach((element) {
update(element);
});
await saveCollection<T>(key, collection);
}