TurboFirestoreGetApi<T> mixin

Extension that adds read/get operations to TFirestoreApi

This extension provides methods for retrieving documents from Firestore

Features:

  • Single document retrieval
  • Type-safe document conversion
  • Document reference access
  • Local ID and reference field management
  • Collection group queries
  • Custom collection path overrides

Example:

final api = TurboFirestoreApi<User>();
final response = await api.getById(id: 'user-123');

See also:

Mixin applications

Properties

collection → CollectionReference<Object?>
The current collection
no setterinherited
doc → DocumentReference<Object?>
A new document
no setterinherited
genId String
Generates a new document ID without creating the document
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
writeBatch → WriteBatch
Helper method to fetch a WriteBatch from _firebaseFirestore..
no setterinherited

Methods

dispose() Future<void>
Releases resources held by this API instance.
inherited
docExists({required String id, String? collectionPathOverride}) Future<bool>
Used to determined if a document exists based on given id.
inherited
getById({required String id, String? collectionPathOverride}) Future<TurboResponse<Map<String, dynamic>>>
Retrieves a document by its unique identifier
getByIdWithConverter({required String id, String? collectionPathOverride}) Future<TurboResponse<T>>
Retrieves and converts a document by its unique identifier
getDocRefById({required String id, String? collectionPathOverride}) → DocumentReference<Map<String, dynamic>>
Gets a document reference by ID for raw data access
getDocRefByIdWithConverter({required String id, String? collectionPathOverride}) → DocumentReference<T>
Gets a document reference with type conversion
getDocSnapshotById({required String id, String? collectionPathOverride}) Future<DocumentSnapshot<Map<String, dynamic>>>
Gets a document snapshot for raw data access
getDocSnapshotByIdWithConverter({required String id, String? collectionPathOverride}) Future<DocumentSnapshot<T>>
Gets a document snapshot with type conversion
listCollectionReference() → Query<Map<String, dynamic>>
Gets a collection reference for raw data access.
inherited
listCollectionReferenceWithConverter() → Query<T>
Gets a collection reference with type conversion.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
runTransaction<E>(TransactionHandler<E> transactionHandler, {Duration timeout = const Duration(seconds: 30), int maxAttempts = 5}) Future<E>
Helper method to run a Transaction from _firebaseFirestore..
inherited
toString() String
A string representation of this object.
inherited
turboVars<V extends TApiVars>() → V
Returns a new instance of V with basic variables filled in.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited