InheritedContext<T> class abstract interface

The element of a provider, as its startListening gets it.

Implemented types
Available extensions

Properties

hashCode → int
The hash code for this object.
no setterinherited
hasValue → bool
Whether the value was created.
no setter
mounted → bool
Whether the element is still mounted: false once it was unmounted.
no setterinherited
owner → BuildOwner?
The owner that builds the tree.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
value → T
The value, created when it is first read.
no setter
widget → Widget
The widget the element currently shows.
no setterinherited

Methods

dependOnInheritedElement(InheritedElement ancestor) → InheritedWidget
Depends on ancestor, the element of an inherited widget above this context, as dependOnInheritedWidgetOfExactType does, and returns its widget.
inherited
dependOnInheritedWidgetOfExactType<T extends InheritedWidget>() → T?
The nearest InheritedWidget of exactly the type T above this context (or the context's own widget), found in constant time; null if there is none.
inherited
findAncestorStateOfType<T extends State<StatefulWidget>>() → T?
The state of the nearest stateful ancestor whose state is a T.
inherited
findAncestorWidgetOfExactType<T extends Widget>() → T?
The widget of the nearest ancestor whose widget is exactly a T.
inherited
findRenderObject() → RenderObject?
The render object of the element, or of the nearest element below it that has one.
inherited
getElementForInheritedWidgetOfExactType<T extends InheritedWidget>() → InheritedElement?
The element of the widget dependOnInheritedWidgetOfExactType finds, without depending on it.
inherited
getInheritedWidgetOfExactType<T extends InheritedWidget>() → T?
The widget dependOnInheritedWidgetOfExactType finds, without depending on it.
inherited
markNeedsNotifyDependents() → void
Tells the widgets that depend on the provider, in the next build, that its value changed.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read<T>() → T

Available on BuildContext, provided by the ReadContext extension

The T of the nearest provider of one above this context, without depending on it: for callbacks, as context.read<Counter>().increment() on a key, and for State.initState. A ProviderNotFoundException if there is none, unless T is nullable: then null.
select<T, R>(R selector(T value)) → R

Available on BuildContext, provided by the SelectContext extension

What selector picks from the T of the nearest provider of one above this context, which is rebuilt only when a change of the value makes selector pick something else: not ==, lists, sets, maps and other iterables compared element by element. A build may select any number of parts, of one value or of several; each build selects anew. A ProviderNotFoundException if there is none, unless T is nullable.
toString() → String
A string representation of this object.
inherited
visitAncestorElements(ConditionalElementVisitor visitor) → void
Calls visitor for each ancestor, nearest first, until it returns false.
inherited
watch<T>() → T

Available on BuildContext, provided by the WatchContext extension

The T of the nearest provider of one above this context, which is rebuilt each time it changes, as long as its builds watch it. A ProviderNotFoundException if there is none, unless T is nullable: then null.

Operators

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