InheritedContext<T> class abstract

A BuildContext associated to an InheritedProvider.

It an extra markNeedsNotifyDependents method and the exposed value.

Available Extensions

Constructors

InheritedContext()

Properties

component → Component
The current configuration of the Element that is this BuildContext.
no setterinherited
debugDoingBuild bool
Whether the component is currently updating the component or render tree.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
hasValue bool
Whether setState was called at least once or not.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value → T
The current value exposed by InheritedProvider.
no setter

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.
inherited
dependOnInheritedElement(InheritedElement ancestor, {Object? aspect}) → InheritedComponent
Registers this build context with ancestor such that when ancestor's component changes this build context is rebuilt.
inherited
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.
inherited
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.
inherited
markNeedsNotifyDependents() → void
Marks the InheritedProvider as needing to update dependents.
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.
inherited
visitChildElements(ElementVisitor visitor) → void
Walks the children of this component.
inherited

Operators

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