BuildContext class
BuildContext is used to know our position in the widget tree. Also it’s used to set the callbacks needed when building or setting the widget the state.
Constructors
- BuildContext()
-
BuildContext.fromParent(BuildContext? parent, {List<
Function> ? callbacks})
Properties
-
callbacks
↔ List<
Function> -
getter/setter pair
- child ↔ BuildContext?
-
getter/setter pair
-
domChildren
↔ List<
BuildContext> ? -
getter/setter pair
- element ↔ Element?
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- mounted → bool
-
no setter
- parent ↔ BuildContext?
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- widget ↔ Widget?
-
getter/setter pair
-
widgetState
↔ StateWidget<
StatefulWidget> ? -
getter/setter pair
Methods
-
addDomElement(
BuildContext context) → void -
addPostFrameCallback(
Function callback) → void - Add a callback which will be executed after initial build or after set state.
-
cachedInflate(
Widget newWidget) → bool -
createChildContext(
{bool copyOldProperties = true, bool copyOldElement = false, bool setChild = true, BuildContext? target}) → BuildContext -
deleteDomChildren(
int i) → void -
executeCallbacks(
{BuildContext? oldContext}) → void - Execute all the callbacks and clear the callback list.
-
findState<
T> () → T -
Looks up the widget tree until it finds a parent of this type or otherwise
throws an exception. Make sure that this widget has been appended by the
appendTo()
method first. -
getWidgetContext(
Widget newWidget) → BuildContext? -
importContext(
BuildContext newContext) → void -
insertDomChildren(
int i, BuildContext context) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
overrideCallbacks(
) → BuildContext - Create a new context object with the given attribute while overriding callbacks.
-
replaceDomChildrenWith(
int i, BuildContext childContext) → void -
shouldReRender(
Widget newWidget) → bool -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
build(
BuildContext context) → BuildContext