FirebaseFirestorePlatform class abstract

Defines an interface to work with Cloud Firestore on web and mobile

Inheritance
  • Object
  • PlatformInterface
  • FirebaseFirestorePlatform

Constructors

FirebaseFirestorePlatform({FirebaseApp? appInstance, String? databaseChoice})
Create an instance using app
FirebaseFirestorePlatform.instanceFor({required FirebaseApp app, required String databaseURL})
Create an instance using app using the existing implementation
factory

Properties

app → FirebaseApp
Returns the FirebaseApp for the current instance.
no setter
appInstance → FirebaseApp?
The FirebaseApp this instance was initialized with.
final
databaseChoice String?
final
databaseURL String
Firestore Database URL for this instance. Falls back to default database: "(default)"
no setter
hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
settings Settings
Get the current Settings for this FirebaseFirestorePlatform instance.
getter/setter pair

Methods

batch() WriteBatchPlatform
Creates a write batch, used for performing multiple writes as a single atomic operation.
clearPersistence() Future<void>
Clears any persisted data for the current instance.
collection(String collectionPath) CollectionReferencePlatform
Gets a CollectionReferencePlatform for the specified Firestore path.
collectionGroup(String collectionPath) QueryPlatform
Gets a QueryPlatform for the specified collection group.
delegateFor({required FirebaseApp app, required String databaseURL}) FirebaseFirestorePlatform
Enables delegates to create new instances of themselves if a none default FirebaseApp instance is required by the user.
disableNetwork() Future<void>
Disables network usage for this instance. It can be re-enabled via enableNetwork(). While the network is disabled, any snapshot listeners or get() calls will return results from cache, and any write operations will be queued until the network is restored.
doc(String documentPath) DocumentReferencePlatform
Gets a DocumentReferencePlatform for the specified Firestore path.
enableNetwork() Future<void>
Re-enables use of the network for this Firestore instance after a prior call to disableNetwork().
enablePersistence([PersistenceSettings? persistenceSettings]) Future<void>
Enable persistence of Firestore data for web-only. Use Settings.persistenceEnabled for non-web platforms. If enablePersistence() is not called, it defaults to Memory cache. If enablePersistence(const PersistenceSettings(synchronizeTabs: false)) is called, it persists data for a single browser tab. If enablePersistence(const PersistenceSettings(synchronizeTabs: true)) is called, it persists data across multiple browser tabs.
loadBundle(Uint8List bundle) LoadBundleTaskPlatform
Loads a Firestore bundle into the local cache. Returns a LoadBundleTask which notifies callers with progress updates, and completion or error events.
namedQueryGet(String name, {GetOptions options = const GetOptions()}) Future<QuerySnapshotPlatform>
Reads a Firestore Query which has been loaded using loadBundle()
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
runTransaction<T>(TransactionHandler<T> transactionHandler, {Duration timeout = const Duration(seconds: 30), int maxAttempts = 5}) Future<T?>
Executes the given TransactionHandler and then attempts to commit the changes applied within an atomic transaction.
setIndexConfiguration(String indexConfiguration) Future<void>
Configures indexing for local query execution. Any previous index configuration is overridden.
setLoggingEnabled(bool enabled) Future<void>
Globally enables / disables Cloud Firestore logging for the SDK.
snapshotsInSync() Stream<void>
Returns a Stream which is called each time all of the active listeners have been synchronised.
terminate() Future<void>
Terminates this FirebaseFirestorePlatform instance.
toString() String
A string representation of this object.
override
useEmulator(String host, int port) → void
useEmulator is used for web only. Native platforms use Firestore settings to initialize emulator.
waitForPendingWrites() Future<void>
Waits until all currently pending writes for the active user have been acknowledged by the backend.

Operators

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

Static Properties

instance FirebaseFirestorePlatform
The current default FirebaseFirestorePlatform instance.
getter/setter pair