Substitution class abstract final

An immutable description of how one ValueListenable object can be used in place of another.

Most commonly used to create a GetScope.

Mixed-in types

Constructors

Substitution(ValueListenable<Object?> placeholder, ValueListenable<Object?> replacement, {bool autoDispose})
factory
Substitution.factory(ValueListenable<Object?> placeholder, ValueGetter<ValueListenable<Object?>> factory, {bool autoDispose})
factory
Substitution.value(ValueListenable<Object?> placeholder, Object? value)
Create a Substitution using a value of the matching type.
This redirects methods like Ref.watch to the provided value.
factory

Properties

autoDispose → bool
Whether to automatically call ChangeNotifier.dispose when the substitution is no longer part of an active GetScope.
final
hashCode → int
The hash code for this object.
no setterinherited
placeholder → ValueListenable<Object?>
The original ValueListenable object (i.e. the listenable encapsulated in a Get object).
final
replacement → ValueListenable<Object?>
A ValueListenable of the same type as the placeholder which will be referenced in its place by methods like Ref.watch called from descendant widgets.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent 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
toStringShort() → String
A brief description of this object, usually just the runtimeType and the hashCode.
inherited

Operators

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

Static Methods

debugSubWidget(BuildContext context, ValueListenable<Object?> placeholder) → GetScope?
If a Substitution was made, returns the GetScope widget that made it.