RxNum class

Inheritance
Available extensions

Constructors

RxNum(num initial)

Properties

bitLength int

Available on Rx<int>, provided by the RxIntExt extension

Returns the minimum number of bits required to store this integer.
no setter
canUpdate bool
no setterinherited
firstRebuild bool
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
isEven bool

Available on Rx<int>, provided by the RxIntExt extension

Returns true if and only if this integer is even.
no setter
isFinite bool

Available on Rx<T>, provided by the RxNumExt extension

True if the number is finite; otherwise, false.
no setter
isInfinite bool

Available on Rx<T>, provided by the RxNumExt extension

True if the number is positive infinity or negative infinity; otherwise, false.
no setter
isNaN bool

Available on Rx<T>, provided by the RxNumExt extension

True if the number is the double Not-a-Number value; otherwise, false.
no setter
isNegative bool

Available on Rx<T>, provided by the RxNumExt extension

True if the number is negative; otherwise, false.
no setter
isOdd bool

Available on Rx<int>, provided by the RxIntExt extension

Returns true if and only if this integer is odd.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sentToStream bool
getter/setter pairinherited
sign double

Available on Rx<double>, provided by the RxDoubleExt extension

Returns the sign of the double's numerical value.
no setter
sign int

Available on Rx<int>, provided by the RxIntExt extension

Returns the sign of this integer.
no setter
sign num

Available on Rx<T>, provided by the RxNumExt extension

Returns minus one, zero or plus one depending on the sign and numerical value of the number.
no setter
stream Stream<num>
no setterinherited
string String
Same as toString() but using a getter.
no setterinherited
subject GetStream<num>
getter/setter pairinherited
value num
Returns the current value
getter/setter pairinherited

Methods

abs() double

Available on Rx<double>, provided by the RxDoubleExt extension

Returns the absolute value of this double.
abs() int

Available on Rx<int>, provided by the RxIntExt extension

Returns the absolute value of this integer.
abs() num

Available on Rx<T>, provided by the RxNumExt extension

Returns the absolute value of this num.
addError(Object error, [StackTrace? stackTrace]) → void
inherited
addListener(GetStream<num> rxGetx) → void
This is an internal method. Subscribe to changes on the inner stream.
inherited
bindStream(Stream<num> stream) → void
Binds an existing Stream<T> to this Rx
inherited
call([num? v]) num
updates the value to null and adds it to the Stream. Even with null-safety coming, is still an important feature to support, as call() doesn't accept null values. For instance, InputDecoration.errorText has to be null to not show the "error state".
inherited
ceil() int

Available on Rx<double>, provided by the RxDoubleExt extension

Returns the least integer no smaller than this.
ceil() int

Available on Rx<int>, provided by the RxIntExt extension

Returns this.
ceil() int

Available on Rx<T>, provided by the RxNumExt extension

Returns the least integer no smaller than this.
ceilToDouble() double

Available on Rx<T>, provided by the RxNumExt extension

Returns the least double integer value no smaller than this.
ceilToDouble() double

Available on Rx<double>, provided by the RxDoubleExt extension

Returns the least integer double value no smaller than this.
ceilToDouble() double

Available on Rx<int>, provided by the RxIntExt extension

Returns this.toDouble().
clamp(num lowerLimit, num upperLimit) num

Available on Rx<T>, provided by the RxNumExt extension

Returns this num clamped to be in the range lowerLimit-upperLimit.
close() → void
Closes the subscriptions for this Rx, releasing the resources.
inherited
floor() int

Available on Rx<double>, provided by the RxDoubleExt extension

Returns the greatest integer no greater than this.
floor() int

Available on Rx<int>, provided by the RxIntExt extension

Returns this.
floor() int

Available on Rx<T>, provided by the RxNumExt extension

Returns the greatest integer no greater than this.
floorToDouble() double

Available on Rx<T>, provided by the RxNumExt extension

Returns the greatest double integer value no greater than this.
floorToDouble() double

Available on Rx<double>, provided by the RxDoubleExt extension

Returns the greatest integer double value no greater than this.
floorToDouble() double

Available on Rx<int>, provided by the RxIntExt extension

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

Available on Rx<int>, provided by the RxIntExt extension

Returns the greatest common divisor of this integer and other.
listen(void onData(num), {Function? onError, void onDone()?, bool? cancelOnError}) StreamSubscription<num>
inherited
listenAndPump(void onData(num event), {Function? onError, void onDone()?, bool? cancelOnError}) StreamSubscription<num>
Returns a StreamSubscription similar to listen, but with the added benefit that it primes the stream with the current value, rather than waiting for the next value. This should not be called in onInit or anywhere else during the build process.
inherited
map<R>(R mapper(num? data)) Stream<R>
inherited
modInverse(int modulus) int

Available on Rx<int>, provided by the RxIntExt extension

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

Available on Rx<int>, provided by the RxIntExt 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
refresh() → void
Makes a direct update of value adding it to the Stream useful when you make use of Rx for custom Types to referesh your UI.
inherited
remainder(num other) num

Available on Rx<T>, provided by the RxNumExt extension

Returns the remainder of the truncating division of this by other.
round() int

Available on Rx<int>, provided by the RxIntExt extension

Returns this.
round() int

Available on Rx<double>, provided by the RxDoubleExt extension

Returns the integer closest to this.
round() int

Available on Rx<T>, provided by the RxNumExt extension

Returns the integer closest to this.
roundToDouble() double

Available on Rx<double>, provided by the RxDoubleExt extension

Returns the integer double value closest to this.
roundToDouble() double

Available on Rx<int>, provided by the RxIntExt extension

Returns this.toDouble().
roundToDouble() double

Available on Rx<T>, provided by the RxNumExt extension

Returns the double integer value closest to this.
toDouble() double

Available on Rx<T>, provided by the RxNumExt extension

Return this num as a double.
toInt() int

Available on Rx<T>, provided by the RxNumExt extension

Truncates this num to an integer and returns the result as an int. */
toJson() → dynamic
Returns the json representation of value.
inherited
toSigned(int width) int

Available on Rx<int>, provided by the RxIntExt 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
toStringAsExponential([int? fractionDigits]) String

Available on Rx<T>, provided by the RxNumExt extension

Returns an exponential string-representation of this.
toStringAsFixed(int fractionDigits) String

Available on Rx<T>, provided by the RxNumExt extension

Returns a decimal-point string-representation of this.
toStringAsPrecision(int precision) String

Available on Rx<T>, provided by the RxNumExt extension

Converts this to a double and returns a string representation with exactly precision significant digits.
toUnsigned(int width) int

Available on Rx<int>, provided by the RxIntExt 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.
trigger(num v) → void
Following certain practices on Rx data, we might want to react to certain listeners when a value has been provided, even if the value is the same. At the moment, we ignore part of the process if we .call(value) with the same value since it holds the value and there's no real need triggering the entire process for the same value inside, but there are other situations where we might be interested in triggering this.
inherited
truncate() int

Available on Rx<T>, provided by the RxNumExt extension

Returns the integer obtained by discarding any fractional digits from this.
truncate() int

Available on Rx<int>, provided by the RxIntExt extension

Returns this.
truncate() int

Available on Rx<double>, provided by the RxDoubleExt extension

Returns the integer obtained by discarding any fractional digits from this.
truncateToDouble() double

Available on Rx<T>, provided by the RxNumExt extension

Returns the double integer value obtained by discarding any fractional digits from the double value of this.
truncateToDouble() double

Available on Rx<int>, provided by the RxIntExt extension

Returns this.toDouble().
truncateToDouble() double

Available on Rx<double>, provided by the RxDoubleExt extension

Returns the integer double value obtained by discarding any fractional digits from this.
update(void fn(num? val)) → void
Uses a callback to update value internally, similar to refresh, but provides the current value as the argument. Makes sense for custom Rx types (like Models).
inherited

Operators

operator %(num other) double

Available on Rx<double>, provided by the RxDoubleExt extension

operator %(num other) num

Available on Rx<T>, provided by the RxNumExt extension

Euclidean modulo operator.
operator &(int other) int

Available on Rx<int>, provided by the RxIntExt extension

Bit-wise and operator.
operator *(num other) double

Available on Rx<double>, provided by the RxDoubleExt extension

Multiplication operator.
operator *(num other) num

Available on Rx<T>, provided by the RxNumExt extension

Multiplication operator.
operator +(num other) num
operator +(num other) Rx<double>

Available on Rx<double>, provided by the RxDoubleExt extension

Addition operator.
operator -(num other) num
Subtraction operator.
operator -(num other) Rx<double>

Available on Rx<double>, provided by the RxDoubleExt extension

Subtraction operator.
operator /(num other) double

Available on Rx<double>, provided by the RxDoubleExt extension

Division operator.
operator /(num other) double

Available on Rx<T>, provided by the RxNumExt extension

Division operator.
operator <(num other) bool

Available on Rx<T>, provided by the RxNumExt extension

Relational less than operator.
operator <<(int shiftAmount) int

Available on Rx<int>, provided by the RxIntExt extension

Shift the bits of this integer to the left by shiftAmount.
operator <=(num other) bool

Available on Rx<T>, provided by the RxNumExt extension

Relational less than or equal operator.
operator ==(Object o) bool
This equality override works for _RxImpl instances and the internal values.
inherited
operator >(num other) bool

Available on Rx<T>, provided by the RxNumExt extension

Relational greater than operator.
operator >=(num other) bool

Available on Rx<T>, provided by the RxNumExt extension

Relational greater than or equal operator.
operator >>(int shiftAmount) int

Available on Rx<int>, provided by the RxIntExt extension

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

Available on Rx<int>, provided by the RxIntExt extension

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

Available on Rx<double>, provided by the RxDoubleExt extension

Negate operator. */
operator unary-() int

Available on Rx<int>, provided by the RxIntExt extension

Return the negative value of this integer.
operator unary-() num

Available on Rx<T>, provided by the RxNumExt extension

Negate operator.
operator |(int other) int

Available on Rx<int>, provided by the RxIntExt extension

Bit-wise or operator.
operator ~() int

Available on Rx<int>, provided by the RxIntExt extension

The bit-wise negate operator.
operator ~/(num other) int

Available on Rx<double>, provided by the RxDoubleExt extension

Truncating division operator.
operator ~/(num other) int

Available on Rx<T>, provided by the RxNumExt extension

Truncating division operator.