withConverter<R> method

DocumentReference<R> withConverter<R>({
  1. required FromFirestore<R> fromFirestore,
  2. required ToFirestore<R> toFirestore,
})

Changes the de/serializing mechanism for this DocumentReference.

This changes the return value of DocumentSnapshot.data.

Implementation

DocumentReference<R> withConverter<R>({
  required FromFirestore<R> fromFirestore,
  required ToFirestore<R> toFirestore,
}) {
  return DocumentReference<R>._(
    firestore: firestore,
    path: _path,
    converter: (
      fromFirestore: fromFirestore,
      toFirestore: toFirestore,
    ),
  );
}