withConverter<R extends Object?> method

DocRef<R> withConverter<R extends Object?>({
  1. required R fromFirestore(
    1. DocumentSnapshotForAll<Object?>,
    2. dynamic
    ),
  2. required Map<String, Object?> toFirestore(
    1. R,
    2. dynamic
    ),
})

Implementation

DocRef<R> withConverter<R extends Object?>(
    {required R Function(DocumentSnapshotForAll, dynamic) fromFirestore,
    required Map<String, Object?> Function(R, dynamic) toFirestore}) {
  FirestoreConverter<R> converter = FirestoreConverter<R>(
      toFirestore: toFirestore, fromFirestore: fromFirestore);
  return DocRef<R>.withReference(reference, converter: converter);
}