Store class final

An object that provides access to Ditto's store.

An instance of Store can be obtained from Ditto.store:

final ditto = await Ditto.open(/* ... */);
final store = ditto.store;

This class is not user-constructible.

This class cannot be sent between isolates.

Annotations
  • @external

Properties

attachmentFetchers → Set<AttachmentFetcher>
Provides the set of all currently active attachment fetchers.
no setter
hashCode → int
The hash code for this object.
no setterinherited
observers → Set<StoreObserver>
Provides the set of all currently active store observers.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

execute(String query, {Map<String, dynamic> arguments = const {}}) → Future<QueryResult>
Executes a DQL query and returns matching items as a QueryResult.
fetchAttachment(Map<String, dynamic> token, void onFetchEvent(AttachmentFetchEvent event)) → AttachmentFetcher
Fetches an attachment by its token and allows monitoring of the fetching process through a callback that handles AttachmentFetchEvents.
newAttachment(StringOrData pathOrData, [AttachmentMetadata? metadata]) → Future<Attachment>
Creates a new Attachment object, which can then be inserted into a document.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerObserver(String query, {Map<String, dynamic> arguments = const {}, void onChange(QueryResult)?}) → StoreObserver
Installs and returns a StoreObserver for a query.
registerObserverV2(String query, {Map<String, dynamic> arguments = const {}, void onChange(QueryResult)?}) → StoreObserverV2
Variant of registerObserverWithSignalNext that automatically signals readiness for the next update once an update has been enqueued to the StoreObserverV2.changes stream and any provided onChange callback has returned.
registerObserverWithSignalNext(String query, {Map<String, dynamic> arguments = const {}, void onChange(QueryResult result, void signalNext())?}) → StoreObserverV2
Registers and returns a StoreObserverV2 for a query, configuring Ditto to trigger onChange and emit events on the StoreObserverV2.changes stream whenever results in the local store change such that the result of the query changes.
toString() → String
A string representation of this object.
inherited
transaction<T>(Future<T> callback(Transaction), {bool isReadOnly = false, String? hint}) → Future<T>
Executes multiple DQL queries within a single atomic transaction.

Operators

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