ActiveDouble class
An ActiveDouble with similar characteristics as a an ordinary dart double object. When an update is done an ActiveStateChanged event is triggered which in-turn makes a UI rebuild of that widget.
Has similar characteristics as double and The value cannot be null
Example
final amount = ActiveDouble(310.0);
print('${amount.add(0.10)}'); //prints 310.10
- Inheritance
-
- Object
- ActiveType<
double> - ActiveDouble
Constructors
- ActiveDouble.new(double value, {String? typeName})
- ActiveDouble.setToZero({String? typeName})
-
setToZero
Sets ActiveDouble value to zero
factory
Properties
- activeController → ActiveController
-
Returns the instance of the ActiveController this
property is associated with.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isNegative → bool
-
A number is negative if it's smaller than zero, or if it is the double
-0.0. This precludes a NaN value like double.nan from being negative.
no setter
- isNotNull → bool
-
Returns true if the value of
this
is not null.no setterinherited - isNull → bool
-
Returns true if the value of
this
is null.no setterinherited - mockValue → double
-
no setterinherited
- originalValue → double
-
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- typeName ↔ String?
-
getter/setter pairinherited
- value → double
-
no setterinherited
Methods
-
add<
E extends num> (E other) → double -
Adds
other
to this number. -
call(
double value, {bool notifyChange = true, bool setAsOriginal = false}) → void -
Updates the underlying
value
for this ActiveType.inherited -
divide<
E extends num> (E other) → double -
Divides this number by
other
. -
equals(
dynamic other) → bool -
Checks if
other
is equal to the value of this ActiveTypeinherited -
mod<
E extends num> (E other) → double -
Euclidean modulo of this number by
other
. -
multiply<
E extends num> (E other) → double -
Multiplies this number by
other
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reset(
{bool notifyChange = true}) → void -
Resets the value to the originalValue.
inherited
-
round(
) → int - Returns the integer closest to the double value.
-
roundToDouble(
) → double - Returns the integer double value closest to the double value.
-
set(
double value, {bool notifyChange = true, bool setAsOriginal = false}) → double -
Updates the property value. Notifies any listeners to the change
inherited
-
setActiveController(
ActiveController activeController) → void -
Links this ActiveType instance with an ActiveController.
inherited
-
setOriginalValueToCurrent(
) → void -
Updates the original value to what the current value of this property is.
inherited
-
subtract<
E extends num> (E other) → double -
Subtracts
other
from this number. -
toInt(
) → int - Truncates this num to an integer and returns the result as an int. Equivalent to truncate.Truncates the double value and returns the int
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
dynamic other) → bool -
The equality operator.
inherited