PersistedIntSignal class

A PersistedSignal that stores an integer value.

Inheritance
Available extensions

Constructors

PersistedIntSignal(int val, String key, {SignalsKeyValueStore? store})
Creates a new IntSignal.

Properties

autoDispose bool
Throws and error if read after dispose and can be disposed on last unsubscribe.
getter/setter pairinherited
bitLength int

Available on ReadonlySignal<int>, provided by the IntSignalExtension extension

Returns the minimum number of bits required to store this integer.
no setter
debugLabel String?
Debug label for Debug Mode
finalinherited
disposed bool
Check if the effect is disposed
getter/setter pairinherited
equalityCheck bool Function(int a, int b)
Optional method to check if to values are the same
getter/setter pairinherited
globalId int
Global ID of the signal
finalinherited
hashCode int
The hash code for this object.
no setterinherited
internalValue int
no setterinherited
isEven bool

Available on ReadonlySignal<int>, provided by the IntSignalExtension extension

Returns true if and only if this integer is even.
no setter
isInitialized bool
Check if a signal value is set (does not subscribe)
no setterinherited
isOdd bool

Available on ReadonlySignal<int>, provided by the IntSignalExtension extension

Returns true if and only if this integer is odd.
no setter
key String
The key to use for storing the value.
finalinherited
loaded bool
Whether the signal has been loaded from the store.
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sign int

Available on ReadonlySignal<int>, provided by the IntSignalExtension extension

Returns the sign of this integer.
no setter
store SignalsKeyValueStore
The store to use for storing the value.
finalinherited
value int
Compute the current value
getter/setter pairinherited
version int
Version numbers should always be >= 0, because the special value -1 is used by Nodes to signify potentially unused but recyclable nodes.
getter/setter pairinherited

Methods

abs() int

Available on ReadonlySignal<int>, provided by the IntSignalExtension extension

Returns the absolute value of this integer.
afterCreate(int val) → void
Internal hook for after a signal is created
inherited
beforeUpdate(int val) → void
Internal hook for after a signal is updated
inherited
call() int
Return the value when invoked
inherited
ceil() int

Available on ReadonlySignal<int>, provided by the IntSignalExtension extension

Returns this.
ceilToDouble() double

Available on ReadonlySignal<int>, provided by the IntSignalExtension extension

Returns this.toDouble().
decode(String value) int
Decodes the value from a string.
override
dispose() → void
Dispose the signal
inherited
encode(int value) String
Encodes the value to a string.
override
floor() int

Available on ReadonlySignal<int>, provided by the IntSignalExtension extension

Returns this.
floorToDouble() double

Available on ReadonlySignal<int>, provided by the IntSignalExtension extension

Returns this.toDouble().
gcd(int other) int

Available on ReadonlySignal<int>, provided by the IntSignalExtension extension

Returns the greatest common divisor of this integer and other.
get() int
Helper method to get the current value
inherited
init() Future<void>
Initializes the signal by loading the value from the store.
inherited
internalRefresh() bool
inherited
load() Future<int>
Loads the value from the store.
inherited
modInverse(int modulus) int

Available on ReadonlySignal<int>, provided by the IntSignalExtension extension

Returns the modular multiplicative inverse of this integer modulo modulus.
modPow(int exponent, int modulus) int

Available on ReadonlySignal<int>, provided by the IntSignalExtension extension

Returns this integer to the power of exponent modulo modulus.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onDispose(void cleanup()) → void Function()
Add a cleanup function to be called when the signal is disposed
inherited
overrideWith(int val) Signal<int>
Override the current signal with a new value as if it was created with it
inherited
peek() int
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
readonly() ReadonlySignal<int>
Returns a readonly signal
inherited
round() int

Available on ReadonlySignal<int>, provided by the IntSignalExtension extension

Returns this.
roundToDouble() double

Available on ReadonlySignal<int>, provided by the IntSignalExtension extension

Returns this.toDouble().
save(int value) Future<void>
Saves the value to the store.
inherited
set(int val, {bool force = false}) bool
Set the current value by a method
inherited
subscribe(void fn(int value)) → void Function()
Subscribe to value changes with a dispose function
inherited
subscribeToNode(Node node) → void
inherited
toJson() → dynamic
Convert value to JSON
inherited
toRadixString(int radix) String

Available on ReadonlySignal<int>, provided by the IntSignalExtension extension

Converts this int to a string representation in the given radix.
toSigned(int width) int

Available on ReadonlySignal<int>, provided by the IntSignalExtension extension

Returns the least significant width bits of this integer, extending the highest retained bit to the sign. This is the same as truncating the value to fit in width bits using an signed 2-s complement representation. The returned value has the same bit value in all positions higher than width.
toString() String
A string representation of this object.
inherited
toUnsigned(int width) int

Available on ReadonlySignal<int>, provided by the IntSignalExtension extension

Returns the least significant width bits of this integer as a non-negative number (i.e. unsigned representation). The returned value has zeros in all bit positions higher than width.
truncate() int

Available on ReadonlySignal<int>, provided by the IntSignalExtension extension

Returns this.
truncateToDouble() double

Available on ReadonlySignal<int>, provided by the IntSignalExtension extension

Returns this.toDouble().
unsubscribeFromNode(Node node) → void
inherited

Operators

operator &(int other) int

Available on ReadonlySignal<int>, provided by the IntSignalExtension extension

Bit-wise and operator.
operator <<(int shiftAmount) int

Available on ReadonlySignal<int>, provided by the IntSignalExtension extension

Shift the bits of this integer to the left by shiftAmount.
operator ==(Object other) bool
The equality operator.
inherited
operator >>(int shiftAmount) int

Available on ReadonlySignal<int>, provided by the IntSignalExtension extension

Shift the bits of this integer to the right by shiftAmount.
operator >>>(int shiftAmount) int

Available on ReadonlySignal<int>, provided by the IntSignalExtension extension

Bitwise unsigned right shift by shiftAmount bits.
operator ^(int other) int

Available on ReadonlySignal<int>, provided by the IntSignalExtension extension

Bit-wise exclusive-or operator.
operator unary-() int

Available on ReadonlySignal<int>, provided by the IntSignalExtension extension

Return the negative value of this integer.
operator |(int other) int

Available on ReadonlySignal<int>, provided by the IntSignalExtension extension

Bit-wise or operator.
operator ~() int

Available on ReadonlySignal<int>, provided by the IntSignalExtension extension

The bit-wise negate operator.