BoundsNotifier class

The observable: one widget's screen geometry, live.

Written by exactly one BoundsObserver (debug-asserted); read and listened to by anything. BoundsAnchor reads the observed widget's liveGeometry at the render tier and repositions the same frame; a NotifierBuilder reacts to bounds at the build tier on the following frame.

Publishing a different value notifies listeners, so a consumer whose own subtree is clean still reacts when the observed widget moves. Equal values are dropped, so a static widget re-publishing identical geometry every frame costs one comparison and never requests another.

Mixed-in types

Constructors

BoundsNotifier()

Properties

bounds → CellRect?
The observed widget's full bounds in absolute cell coordinates — including any portion scrolled out of view — or null while the widget is not presented (not yet laid out, hidden, or gone from the tree).
no setter
hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether at least one listener is registered.
no setterinherited
liveGeometry → RenderGeometry?
The observed widget's geometry as derived from layout right now, read straight from the observer rather than from the last publication. Render-tier consumers use it during their own frame so they place themselves against the observed widget's current position regardless of paint order. A notifier nobody observes — one published by hand, or by a programmatic source — reports its last publication instead.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
visibleBounds → CellRect?
The on-screen portion of bounds, or null when the widget is fully scrolled or clipped out of view. BoundsAnchor hides while this is null.
no setter

Methods

addListener(VoidCallback listener) → void
Registers listener to be called when this object changes.
inherited
claimWriter(Object writer) → void
Debug-enforces the single-writer contract: a notifier observed by two BoundsObservers would silently carry whichever painted last.
dispose() → void
Marks this notifier as disposed and drops its listeners. Nulls the slots in place (rather than replacing the backing list) so a dispose called from within a listener leaves any in-progress notify walk reading valid, now-empty slots. After disposal, addListener and notify throw; removeListener remains safe for cleanup.
inherited
listen(VoidCallback listener) → VoidCallback
Registers listener and returns an idempotent cancellation function.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notify() → void
Publishes a change to every listener registered when the pass began.
inherited
publish(RenderGeometry? geometry) → bool
Publishes a new observation. Called by the owning BoundsObserver; not intended for app code.
releaseWriter(Object writer) → void
Releases the writer claim (observer unmounted or switched notifier).
removeListener(VoidCallback listener) → void
Removes a previously-registered listener.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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