data method

T? data()

The data of the document (converted with the converter of the reference or query it was read through, if any), or null if the document does not exist.

Implementation

T? data() {
  final Document? doc = document;
  if (doc == null) {
    return null;
  }
  final FirestoreDataConverter<T>? converter = _converter;
  if (converter == null) {
    return _convertObject(doc.data) as T;
  }
  return converter.fromFirestore(
    QueryDocumentSnapshot<Map<String, Object?>>(_firestore, doc),
  );
}