create method

  1. @override
Future<Model> create({
  1. String? wantedId,
})
override

Creates a new entry in the repository.

Implementation

@override
Future<Model> create({String? wantedId}) async {
  final DocumentReference docReference = _collectionReference.doc(wantedId);
  final Model model = Model(id: docReference.id);

  await docReference.set(model.data);
  _handleDocRealTimeUpdate(docReference);
  return model;
}