addAutoIdentified method

  1. @override
Future<T> addAutoIdentified(
  1. T object, {
  2. T updateObjectWithId(
    1. T object,
    2. String id
    )?,
})
override

Convenience method that combines autoIdentify and add.

If updateObjectWithId is provided, the object is updated with the generated ID. If not provided, the object remains unchanged.

Implementation

@override
Future<T> addAutoIdentified(T object, {T Function(T object, String id)? updateObjectWithId}) async {
  final autoIdentifiedObject = autoIdentify(object, updateObjectWithId: updateObjectWithId);
  return add(autoIdentifiedObject);
}