addDocument method

Future<DocumentReference<Object?>> addDocument({
  1. String? id,
  2. required Map<String, dynamic> data,
})

Implementation

Future<DocumentReference> addDocument(
    {String? id, required Map<String, dynamic> data}) async {
  final docRef = ref.doc(id);
  await docRef.set(data);
  return docRef;
}