ActiveInt class

An ActiveInt with similar characteristics as a an ordinary dart int 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 int and The value cannot be null

Example


final age = ActiveInt(10);

print('${age.add(5)}'); //prints 15
Inheritance

Constructors

ActiveInt.new(int value, {String? typeName})
ActiveInt.zero({String? typeName})
Factory constructor for initializing an ActiveInt 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
isEven bool
Returns true if the int value is even.
no setter
isNegative bool
Whether this number is 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
isOdd bool
Returns true if the int value is odd
no setter
mockValue int
no setterinherited
originalValue int
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
typeName String?
getter/setter pairinherited
value int
no setterinherited

Methods

abs() int
Returns the absolute value of this integer.
add<E extends num>(E other) → E
Adds other to this number.
call(int value, {bool notifyChange = true, bool setAsOriginal = false}) → void
Updates the underlying value for this ActiveType.
inherited
decrement({bool notifyChange = true}) int
Decrement the int value by 1
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 ActiveType
inherited
increment({bool notifyChange = true}) int
Increment the int value by 1
mod<E extends num>(E other) → E
Euclidean modulo of this number by other.
multiply<E extends num>(E other) → E
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
set(int value, {bool notifyChange = true, bool setAsOriginal = false}) int
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) → E
Subtracts other from this number.
toDouble() double
The int value as a double
toString() String
A string representation of this object.
inherited

Operators

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