EmpireIntProperty class Null safety

An EmpireProperty with similar characteristics of dart int objects

The underlying value cannot be null. For a nullable int empire property, use the EmpireNullableIntProperty.

You can perform most arithmetic operator on this (+, -, /, *).

Unary operators are not supported (++, --, +=, -=, etc)

When the value of this changes, it will send a EmpireStateChanged event by default. This includes automatically triggering a UI rebuild.

Example


late final EmpireIntProperty age;

age = createIntProperty(10);

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

Constructors

EmpireIntProperty(int value, EmpireViewModel viewModel, {String? propertyName})

Properties

hashCode int
The hash code for this object.
read-only, inherited
isEven bool
Returns true if the int value is even.
read-only
isNegative bool
Whether this number is negative.
read-only
isNotNull bool
read-only, inherited
isNull bool
read-only, inherited
isOdd bool
Returns true if the int value is odd
read-only
originalValue int
read-only, inherited
propertyName String?
read / write, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
value int
read-only, inherited

Methods

abs() int
Returns the absolute value of this integer.
call(int value, {bool notifyChange = true}) → void
inherited
equals(dynamic other) bool
Checks if other is equal to the value of this EmpireProperty
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
reset({bool notifyChange = true}) → void
Resets the value to what it was initialized with.
inherited
set(int value, {bool notifyChange = true}) int
Updates the property value. Notifies any listeners to the change
inherited
setOriginalValueToCurrent() → void
Updates the original value to what the current value of this property is.
inherited
toDouble() double
The int value as a double
toString() String
A string representation of this object.
inherited

Operators

operator %(dynamic other) int
operator *(dynamic other) int
operator +(dynamic other) int
operator -(dynamic other) int
operator /(dynamic other) int
operator ==(dynamic other) bool
The equality operator.
inherited