BuildOwner class
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 hot reload when 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
- debugBuilding → bool
-
Whether this widget tree is in the build phase. [...]
read-only
- focusManager → FocusManager
-
The object in charge of the focus tree. [...]
final
- onBuildScheduled ↔ VoidCallback
-
Called on each build pass when the first buildable element is marked
dirty.
read / write
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
buildScope(
Element 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
. [...] -
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 and is being hot-reloaded, to cause the widget tree to pick up any changed implementations. [...]
-
scheduleBuildFor(
Element element) → void - Adds an element to the dirty elements list so that it will be rebuilt when WidgetsBinding.drawFrame 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
Operators
-
operator ==(
dynamic other) → bool -
The equality operator. [...]
inherited