updateEntity method

  1. @override
Future<RoomEntity> updateEntity(
  1. String documentID,
  2. RoomEntity value
)
override

Implementation

@override
Future<RoomEntity> updateEntity(String documentID, RoomEntity value) {
  return roomCollection
      .doc(documentID)
      .update(value.toDocument())
      .then((_) => value)
      .then((v) async {
    var newValue = await getEntity(documentID);
    if (newValue == null) {
      return value;
    } else {
      return newValue;
    }
  });
}