ReadonlySignalProvider<T> class

Convenience method to pass signals with InheritedWidget

Inheritance
Available extensions

Constructors

ReadonlySignalProvider({Key? key, required Widget child, required ReadonlySignal<T> create()})
Create a new ReadonlySignal by value to provide in a widget tree
ReadonlySignalProvider.value({Key? key, required Widget child, required ReadonlySignal<T> value})
Pass a ReadonlySignal by value to provide in a widget tree
const

Properties

autoDispose bool
Throws and error if read after dispose and can be disposed on last unsubscribe.
no setterinherited
child Widget
The widget below this widget in the tree.
finalinherited
debugLabel String?
Debug label for Debug Mode
no setterinherited
disposed bool
Returns true if dispose has been called and will throw and error on value read
getter/setter pairinherited
globalId int
Global ID of the signal
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
hasTargets bool
Check if there are any targets attached
no setterinherited
initialValue → T
Value that the signal was created with
no setterinherited
instance ReadonlySignal<T>
Internal signal
finalinherited
isInitialized bool
Check if the signal is lazy and has not had a value set
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
previousValue → T?
Previous value that was set before the current
no setterinherited
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 setterinherited
value → T
Compute the current value
no setterinherited
version int
Version number is used to track changes and will increment for every set
no setterinherited

Methods

call() → T
Return the value when invoked
inherited
createElement() InheritedSignalElement<dynamic, ReadonlySignal>
Inflates this configuration to a concrete instance.
inherited
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
inherited
get() → T
Get the current value
inherited
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
inherited
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().
inherited
subscribe(void fn(T value)) EffectCleanup
Subscribe to value changes
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
toJson() → dynamic
Convert value to JSON
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
updateShouldNotify(covariant InheritedSignalProvider<T, ReadonlySignal<T>> oldWidget) bool
Whether the framework should notify widgets that inherit from this widget.
inherited

Operators

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

Static Methods

of<T>(BuildContext context, {bool listen = true}) ReadonlySignal<T>
Look up a signal by its type
override