InheritedContext<T> class

A BuildContext associated to an InheritedProvider.

It an extra markNeedsNotifyDependents method and the exposed value.

Inheritance

Constructors

InheritedContext()

Properties

hasValue → bool
Wether setState was called at least once or not. [...]
read-only
value → T
The current value exposed by InheritedProvider. [...]
read-only
hashCode → int
The hash code for this object.
read-only, inherited
owner BuildOwner
The BuildOwner for this context. The BuildOwner is in charge of managing the rendering pipeline for this context.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited
size Size
The size of the RenderBox returned by findRenderObject.
read-only, inherited
widget Widget
The current configuration of the Element that is this BuildContext.
read-only, inherited

Methods

markNeedsNotifyDependents() → void
Marks the InheritedProvider as needing to update dependents. [...]
ancestorInheritedElementForWidgetOfExactType(Type targetType) InheritedElement
Obtains the element corresponding to the nearest widget of the given type, which must be the type of a concrete InheritedWidget subclass.
@Deprecated('Use getElementForInheritedWidgetOfExactType instead. ' 'This feature was deprecated after v1.12.1.'), inherited
ancestorRenderObjectOfType(TypeMatcher matcher) RenderObject
Returns the RenderObject object of the nearest ancestor RenderObjectWidget widget that matches the given TypeMatcher.
@Deprecated('Use findAncestorRenderObjectOfType instead. ' 'This feature was deprecated after v1.12.1.'), inherited
ancestorStateOfType(TypeMatcher matcher) State<StatefulWidget>
Returns the State object of the nearest ancestor StatefulWidget widget that matches the given TypeMatcher.
@Deprecated('Use findAncestorStateOfType instead. ' 'This feature was deprecated after v1.12.1.'), inherited
ancestorWidgetOfExactType(Type targetType) Widget
Returns the nearest ancestor widget of the given type, which must be the type of a concrete Widget subclass.
@Deprecated('Use findAncestorWidgetOfExactType instead. ' 'This feature was deprecated after v1.12.1.'), inherited
dependOnInheritedElement(InheritedElement ancestor, {Object aspect}) InheritedWidget
Registers this build context with ancestor such that when ancestor's widget changes this build context is rebuilt.
inherited
dependOnInheritedWidgetOfExactType<T extends InheritedWidget>({Object aspect}) → T
Obtains the nearest widget of the given type T, which must be the type of a concrete InheritedWidget subclass, and registers this build context with that widget such that when that widget changes (or a new widget of that type is introduced, or the widget goes away), this build context is rebuilt so that it can obtain new values from that widget.
inherited
describeElement(String name, {DiagnosticsTreeStyle style: DiagnosticsTreeStyle.errorProperty}) DiagnosticsNode
Returns a description of an Element from the current build context.
inherited
describeMissingAncestor({Type expectedAncestorType}) → List<DiagnosticsNode>
Adds a description of a specific type of widget missing from the current build context's ancestry tree.
inherited
describeOwnershipChain(String name) DiagnosticsNode
Adds a description of the ownership chain from a specific Element to the error report.
inherited
describeWidget(String name, {DiagnosticsTreeStyle style: DiagnosticsTreeStyle.errorProperty}) DiagnosticsNode
Returns a description of the Widget associated with the current build context.
inherited
findAncestorRenderObjectOfType<T extends RenderObject>() → T
Returns the RenderObject object of the nearest ancestor RenderObjectWidget widget that is an instance of the given type T.
inherited
findAncestorStateOfType<T extends State<StatefulWidget>>() → T
Returns the State object of the nearest ancestor StatefulWidget widget that is an instance of the given type T.
inherited
findAncestorWidgetOfExactType<T extends Widget>() → T
Returns the nearest ancestor widget of the given type T, which must be the type of a concrete Widget subclass.
inherited
findRenderObject() RenderObject
The current RenderObject for the widget. If the widget is a RenderObjectWidget, this is the render object that the widget created for itself. Otherwise, it is the render object of the first descendant RenderObjectWidget.
inherited
findRootAncestorStateOfType<T extends State<StatefulWidget>>() → T
Returns the State object of the furthest ancestor StatefulWidget widget that is an instance of the given type T.
inherited
getElementForInheritedWidgetOfExactType<T extends InheritedWidget>() InheritedElement
Obtains the element corresponding to the nearest widget of the given type T, which must be the type of a concrete InheritedWidget subclass.
inherited
inheritFromElement(InheritedElement ancestor, {Object aspect}) InheritedWidget
Registers this build context with ancestor such that when ancestor's widget changes this build context is rebuilt.
@Deprecated('Use dependOnInheritedElement instead. ' 'This feature was deprecated after v1.12.1.'), inherited
inheritFromWidgetOfExactType(Type targetType, {Object aspect}) InheritedWidget
Obtains the nearest widget of the given type, which must be the type of a concrete InheritedWidget subclass, and registers this build context with that widget such that when that widget changes (or a new widget of that type is introduced, or the widget goes away), this build context is rebuilt so that it can obtain new values from that widget.
@Deprecated('Use dependOnInheritedWidgetOfExactType instead. ' 'This feature was deprecated after v1.12.1.'), inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
rootAncestorStateOfType(TypeMatcher matcher) State<StatefulWidget>
Returns the State object of the furthest ancestor StatefulWidget widget that matches the given TypeMatcher.
@Deprecated('Use findRootAncestorStateOfType instead. ' 'This feature was deprecated after v1.12.1.'), inherited
toString() → String
Returns 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 widget, invoking the argument for each ancestor. The callback is given a reference to the ancestor widget's corresponding Element object. The walk stops when it reaches the root widget or when the callback returns false. The callback must not return null.
inherited
visitChildElements(ElementVisitor visitor) → void
Walks the children of this widget.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator.
inherited