deleteValueFromCollection<T> static method

Future deleteValueFromCollection<T>(
  1. String key, {
  2. dynamic value,
})

Delete a value from a collection using a key and the value you want to remove.

Implementation

static Future deleteValueFromCollection<T>(String key,
    {dynamic value}) async {
  List<T> collection = await readCollection<T>(key);
  collection.removeWhere((item) => item == value);
  await saveCollection<T>(key, collection);
}