Cindel exposes every watched scope as a standard DartDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/mainser/cindel/llms.txt
Use this file to discover all available pages before exploring further.
Stream, which means you can use it directly with Flutter’s StreamBuilder, call .listen() from any class, or compose it with other stream operators. Watchers are backed by the database’s change-notification layer and only fire after a write transaction commits successfully — a rolled-back transaction never notifies any subscriber.
Watching a Single Object
watchObject(id) emits a typed snapshot of the object every time its underlying document changes. When the object is deleted the stream emits null:
watchObject fires immediately with the current stored value (fireImmediately: true). Pass fireImmediately: false to receive only future changes:
Watching an Entire Collection
watchCollection() emits the full typed list of every object in the collection on each change. The snapshot includes all documents in their natural order:
watchObject, the default is fireImmediately: true. Supply fireImmediately: false to skip the initial emission.
Watching a Query
Attach.watch() to any generated query chain. The stream emits the typed list of matching objects after each commit that could affect the result:
Lazy Watchers
Lazy watchers emit avoid invalidation signal rather than materializing the objects. They are useful when you maintain your own local cache and only need to know that something changed, not what changed:
watchObjectLazy(id) provides the same behaviour at the single-object level:
fireImmediately: false so they do not emit on subscription — only future changes trigger the callback.
Cancelling Subscriptions
All watcher methods return a standardStreamSubscription. Cancel it when the subscribing widget or scope disposes to avoid memory leaks:
Flutter Widget Example
The most common Flutter pattern isStreamBuilder, which handles subscription lifetime automatically:
watch() stream starts with fireImmediately: true by default, so snapshot.hasData becomes true after the first emission before any user interaction occurs.