BuildContext class abstract

The BuildContext supplied to a Components build() method, as known from Flutter

Implementers

Constructors

BuildContext()

Properties

binding AppBinding
The root component binding that manages the component tree.
no setter
component Component
The current configuration of the Element that is this BuildContext.
no setter
debugDoingBuild bool
Whether the component is currently updating the component or render tree.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dependOnInheritedComponentOfExactType<T extends InheritedComponent>({Object? aspect}) → T?
Obtains the nearest component of the given type T, which must be the type of a concrete InheritedComponent subclass, and registers this build context with that component such that when that component changes (or a new component of that type is introduced, or the component goes away), this build context is rebuilt so that it can obtain new values from that component.
dependOnInheritedElement(InheritedElement ancestor, {Object? aspect}) InheritedComponent
Registers this build context with ancestor such that when ancestor's component changes this build context is rebuilt.
dispatchNotification(Notification notification) → void
Start bubbling this notification at the given build context.
findAncestorStateOfType<T extends State<StatefulComponent>>() → T?
Returns the State object of the nearest ancestor StatefulComponent component that is an instance of the given type T.
getElementForInheritedComponentOfExactType<T extends InheritedComponent>() InheritedElement?
Obtains the element corresponding to the nearest component of the given type T, which must be the type of a concrete InheritedComponent subclass.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
visitAncestorElements(bool visitor(Element element)) → void
Walks the ancestor chain, starting with the parent of this build context's component, invoking the argument for each ancestor. The callback is given a reference to the ancestor component's corresponding Element object. The walk stops when it reaches the root component or when the callback returns false. The callback must not return null.
visitChildElements(ElementVisitor visitor) → void
Walks the children of this component.

Operators

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