TuiBinding class

Per-runtime registry of cross-cutting framework services. Reachable from any descendant context via TuiBinding.of.

Implemented types

Constructors

TuiBinding({TickerScheduler? tickerScheduler, AnimationPolicy animationPolicy = AnimationPolicy.enabled})
Creates a binding. When tickerScheduler is null a default TickerScheduler is created with the SystemClock. Tests almost always pass an explicit FakeTickerScheduler backed by a FakeClock.

Properties

animationPolicy → AnimationPolicy
The currently-effective animation policy. Set at binding construction; runtime mutation lands later if a real use case appears.
no setteroverride
hashCode → int
The hash code for this object.
no setterinherited
onPostFrameCallback ↔ void Function()?
Hook the runtime installs to wire post-frame callback registration into frame scheduling. FleuryTester schedules only while a command or semantic action is pending; otherwise its explicit pump drains the callbacks synchronously.
getter/setter pair
rootNavigator ↔ NavigatorState?
The application's root navigator — the top-level NavigatorState with no enclosing navigator. A root-level Navigator registers itself here when it mounts and clears it on dispose. Lets non-widget code (a socket handler, a timer) drive top-level navigation without threading a BuildContext. Null until a root-level navigator mounts.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tickerScheduler → TickerScheduler
The animation scheduler for this runtime. All Tickers created via this binding (or via any SingleTickerProviderStateMixin in this runtime's tree) register with this scheduler.
final

Methods

addPostFrameCallback(FrameCallback callback) → void
Queues callback to fire once after the next frame's bytes have been emitted. Use from initState (or anywhere) when a value is only available after layout — e.g. reading a render object's painted size with BuildContext.findRenderObject.
createTicker(TickerCallback onTick) → Ticker
Creates a Ticker registered against this binding's scheduler. Implements TickerProvider for non-widget contexts that hold a binding reference directly.
override
dispose() → void
Releases the binding's resources. Idempotent. Tickers registered against the scheduler should be disposed first.
flushPostFrameCallbacks(Duration timeStamp) → void
Drains the post-frame callback queue. Called by the runtime (native + web) after renderer.renderDiff and by FleuryTester.pump after layout and paint. Idempotent — a no-op when no callbacks are queued.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

maybeOf(BuildContext context) → TuiBinding?
Variant of of that returns null instead of throwing.
of(BuildContext context) → TuiBinding
Returns the TuiBinding enclosing context. Throws if no binding is installed — almost always means runApp wasn't used or the call site is outside the app's root.