InheritedWidget class Null safety

Base class for widgets that efficiently propagate information down the tree.

To obtain the nearest instance of a particular type of inherited widget from a build context, use BuildContext.dependOnInheritedWidgetOfExactType.

Inherited widgets, when referenced in this way, will cause the consumer to rebuild when the inherited widget itself changes state.

Inheritance
Annotations

Constructors

InheritedWidget({Key? key, required Widget child})
const

Properties

child Widget
final
correspondingTag DomTagType?
Corresponding HTML tag to use to render this widget
@nonVirtual, read-only, override
hashCode int
The hash code for this object.
read-only, inherited
initialKey Key
final, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
widgetCaptureEventListeners Map<DomEventType, EventCallback?>
Events that this widget is listening to in capturing phase.
read-only, inherited
widgetChildren List<Widget>
Child widgets if any.
read-only, override
widgetEventListeners Map<DomEventType, EventCallback?>
Events that this widget is listening to.
read-only, inherited
widgetType String
Type of widget.
@nonVirtual, read-only, override

Methods

createConfiguration() WidgetConfiguration
Create widget's configuration.
@nonVirtual, override
createRenderObject(BuildContext context) RenderObject
Called when framework needs a RenderObject for current widget.
@nonVirtual, override
isConfigurationChanged(WidgetConfiguration oldConfiguration) bool
Whether configuration has changed.
@nonVirtual, override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
updateShouldNotify(covariant InheritedWidget oldWidget) bool
Whether the framework should notify widgets that inherit from this widget.

Operators

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