InheritedSignalProvider<T, S extends ReadonlySignal<T>> class

Inheritance
Implemented types
Implementers
Available extensions

Constructors

InheritedSignalProvider({Key? key, required S create(), required Widget child})
Create a new ReadonlySignal and provide it in the tree
InheritedSignalProvider.value({Key? key, required S value, required Widget child})
Pass a ReadonlySignal and provide it in the tree
const

Properties

autoDispose bool
Throws and error if read after dispose and can be disposed on last unsubscribe.
no setteroverride
child Widget
The widget below this widget in the tree.
finalinherited
debugLabel String?
Debug label for Debug Mode
no setteroverride
disposed bool
Returns true if dispose has been called and will throw and error on value read
getter/setter pairoverride
globalId int
Global ID of the signal
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
hasTargets bool
Check if there are any targets attached
no setteroverride
initialValue → T
Value that the signal was created with
no setteroverride
instance → S
Internal signal
final
isInitialized bool
Check if the signal is lazy and has not had a value set
no setteroverride
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
previousValue → T?
Previous value that was set before the current
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
targets Iterable<SignalListenable>
@internal for testing getter to track all the effects currently effected in the signal
no setteroverride
value → T
Compute the current value
no setteroverride
version int
Version number is used to track changes and will increment for every set
no setteroverride

Methods

call() → T
Return the value when invoked
override
createElement() InheritedSignalElement<dynamic, ReadonlySignal>
Inflates this configuration to a concrete instance.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
dispose() → void
Dispose the signal
override
get() → T
Get the current value
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onDispose(void cleanup()) EffectCleanup
Add a cleanup function to be called when the signal is disposed
override
peek() → T
In the rare instance that you have an effect that should write to another signal based on the previous value, but you don't want the effect to be subscribed to that signal, you can read a signals's previous value via signal.peek().
override
subscribe(void fn(T value)) EffectCleanup
Subscribe to value changes
override
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toJson() → dynamic
Convert value to JSON
override
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
override
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
updateShouldNotify(covariant InheritedSignalProvider<T, S> oldWidget) bool
Whether the framework should notify widgets that inherit from this widget.
override

Operators

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

Static Methods

of<T extends InheritedWidget>(BuildContext context, {bool listen = true}) → T?
Find widget in tree