ObservableLocatorScope class Null safety

A scope that provides an ObservableLocator to its widget subtree.

Typically, a root scope is created using the default constructor or ObservableLocatorScope.value constructor.

Then, within the widget tree, the ObservableLocatorScope.child constructor is used to create child observable locators that only provide values scoped to a specific widget subtree.

Inheritance

Constructors

ObservableLocatorScope({Key? key, required CreateBinders create, TransitionBuilder? builder, Widget? child})
Create a scope that provides an ObservableLocator which is managed (i.e. created and disposed) by this widget.
factory
ObservableLocatorScope.child({Key? key, required CreateBinders create, TransitionBuilder? builder, Widget? child})
Create a scope that provides a child of an ancestor ObservableLocator.
factory
ObservableLocatorScope.value(ObservableLocator locator, {Key? key, TransitionBuilder? builder, Widget? child})
Create a scope that provides the given ObservableLocator.
factory

Properties

builder TransitionBuilder?
final
hashCode int
The hash code for this object.
@nonVirtualread-onlyinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

createElement() → SingleChildStatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createLocator(BuildContext context) → ObservableLocator
createState() → _ObservableLocatorScopeState
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
@protectedinherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
disposeLocator(BuildContext context, ObservableLocator locator) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited
updateLocator(BuildContext context, ObservableLocator locator) → ObservableLocator

Operators

operator ==(Object other) bool
The equality operator.
@nonVirtualinherited

Static Methods

of(BuildContext context, {bool listen = true}) → ObservableLocator
The ObservableLocator of the closest ObservableLocatorScope that surrounds the given context.