PersistedIntSignal class
A PersistedSignal that stores an integer value.
- Inheritance
-
- Object
- Signal<
int> - PersistedSignal<
int> - PersistedIntSignal
- 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<
Returns the minimum number of bits required to store this integer.int> , provided by the IntSignalExtension extensionno 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<
Returns true if and only if this integer is even.int> , provided by the IntSignalExtension extensionno setter - isInitialized → bool
-
Check if a signal value is set (does not subscribe)
no setterinherited
- isOdd → bool
-
Available on ReadonlySignal<
Returns true if and only if this integer is odd.int> , provided by the IntSignalExtension extensionno 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<
Returns the sign of this integer.int> , provided by the IntSignalExtension extensionno 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<
Returns the absolute value of this integer.int> , provided by the IntSignalExtension extension -
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<
Returnsint> , provided by the IntSignalExtension extensionthis. -
ceilToDouble(
) → double -
Available on ReadonlySignal<
Returnsint> , provided by the IntSignalExtension extensionthis.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<
Returnsint> , provided by the IntSignalExtension extensionthis. -
floorToDouble(
) → double -
Available on ReadonlySignal<
Returnsint> , provided by the IntSignalExtension extensionthis.toDouble(). -
gcd(
int other) → int -
Available on ReadonlySignal<
Returns the greatest common divisor of this integer andint> , provided by the IntSignalExtension extensionother. -
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<
Returns the modular multiplicative inverse of this integer moduloint> , provided by the IntSignalExtension extensionmodulus. -
modPow(
int exponent, int modulus) → int -
Available on ReadonlySignal<
Returns this integer to the power ofint> , provided by the IntSignalExtension extensionexponentmodulomodulus. -
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<
Returnsint> , provided by the IntSignalExtension extensionthis. -
roundToDouble(
) → double -
Available on ReadonlySignal<
Returnsint> , provided by the IntSignalExtension extensionthis.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<
Converts this int to a string representation in the givenint> , provided by the IntSignalExtension extensionradix. -
toSigned(
int width) → int -
Available on ReadonlySignal<
Returns the least significantint> , provided by the IntSignalExtension extensionwidthbits of this integer, extending the highest retained bit to the sign. This is the same as truncating the value to fit inwidthbits using an signed 2-s complement representation. The returned value has the same bit value in all positions higher thanwidth. -
toString(
) → String -
A string representation of this object.
inherited
-
toUnsigned(
int width) → int -
Available on ReadonlySignal<
Returns the least significantint> , provided by the IntSignalExtension extensionwidthbits of this integer as a non-negative number (i.e. unsigned representation). The returned value has zeros in all bit positions higher thanwidth. -
truncate(
) → int -
Available on ReadonlySignal<
Returnsint> , provided by the IntSignalExtension extensionthis. -
truncateToDouble(
) → double -
Available on ReadonlySignal<
Returnsint> , provided by the IntSignalExtension extensionthis.toDouble(). -
unsubscribeFromNode(
Node node) → void -
inherited
Operators
-
operator &(
int other) → int -
Available on ReadonlySignal<
Bit-wise and operator.int> , provided by the IntSignalExtension extension -
operator <<(
int shiftAmount) → int -
Available on ReadonlySignal<
Shift the bits of this integer to the left byint> , provided by the IntSignalExtension extensionshiftAmount. -
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator >>(
int shiftAmount) → int -
Available on ReadonlySignal<
Shift the bits of this integer to the right byint> , provided by the IntSignalExtension extensionshiftAmount. -
operator >>>(
int shiftAmount) → int -
Available on ReadonlySignal<
Bitwise unsigned right shift byint> , provided by the IntSignalExtension extensionshiftAmountbits. -
operator ^(
int other) → int -
Available on ReadonlySignal<
Bit-wise exclusive-or operator.int> , provided by the IntSignalExtension extension -
operator unary-(
) → int -
Available on ReadonlySignal<
Return the negative value of this integer.int> , provided by the IntSignalExtension extension -
operator |(
int other) → int -
Available on ReadonlySignal<
Bit-wise or operator.int> , provided by the IntSignalExtension extension -
operator ~(
) → int -
Available on ReadonlySignal<
The bit-wise negate operator.int> , provided by the IntSignalExtension extension