removeFromList<T> method

void removeFromList<T>(
  1. String key,
  2. T value
)

Function to remove a value from a list in the room

Implementation

void removeFromList<T>(String key, T value) {
  // Find the key of the value
  for (MapEntry<String, dynamic> entry in getMap(key).entries) {
    if (entry.value == value) {
      ref!.child(key).child(entry.key).remove();
      return;
    }
  }
}