InheritedWidget class abstract

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
  • @immutable

Constructors

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

Properties

child Widget
Child widget.
final
correspondingTag DomTagType?
Corresponding HTML tag to use to render this widget
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
key Key?
Keys help Rad identify which widgets have changed, are added, or are removed when a widget has multiple sibling widgets.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
widgetCaptureEventListeners Map<DomEventType, EventCallback?>
Events that this widget is listening to in capturing phase.
no setterinherited
widgetEventListeners Map<DomEventType, EventCallback?>
Events that this widget is listening to in bubbling phase.
no setterinherited

Methods

createRenderElement(RenderElement parent) RenderElement
Create element for current widget.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shouldUpdateWidget(Widget oldWidget) bool
Whether to update current widget.
override
shouldUpdateWidgetChildren(Widget oldWidget, bool shouldUpdateWidget) bool
Whether to update current widget's children.
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