Manager class for the widgets framework.

This class tracks which widgets need rebuilding, and handles other tasks that apply to widget trees as a whole, such as managing the inactive element list for the tree and triggering the "reassemble" command when necessary during debugging.

The main build owner is typically owned by the WidgetsBinding, and is driven from the operating system along with the rest of the build/layout/paint pipeline.

Additional build owners can be built to manage off-screen widget trees.

To assign a build owner to a tree, use the RootRenderObjectElement.assignOwner method on the root element of the widget tree.

Constructors

BuildOwner({VoidCallback onBuildScheduled })

Creates an object that manages widgets.

Properties

onBuildScheduled VoidCallback

Called on each build pass when the first buildable element is marked dirty.

read / write
hashCode int

Get a hash code for this object.

read-only, inherited
runtimeType Type

A representation of the runtime type of the object.

read-only, inherited

Operators

operator ==(other) bool

The equality operator.

inherited

Methods

buildScope(BuildableElement context, [ VoidCallback callback ]) → void

Establishes a scope for updating the widget tree, and calls the given callback, if any. Then, builds all the elements that were marked as dirty using scheduleBuildFor, in depth order.

finalizeTree() → void

Complete the element build pass by unmounting any elements that are no longer active.

lockState(void callback()) → void

Establishes a scope in which calls to State.setState are forbidden, and calls the given callback.

markNeedsToResortDirtyElements() → void

Flags the dirty elements list as needing resorting.

reassemble(Element root) → void

Cause the entire subtree rooted at the given Element to be entirely rebuilt. This is used by development tools when the application code has changed, to cause the widget tree to pick up any changed implementations.

scheduleBuildFor(BuildableElement element) → void

Adds an element to the dirty elements list so that it will be rebuilt when WidgetsBinding.beginFrame calls buildScope.

noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited
toString() String

Returns a string representation of this object.

inherited