Box<T> class
A mutable wrapper designed to hold and update values.
Unlike Var<T> or Ref<T>, Box<T> is intensely overloaded, mimicking
the robust flexibility of idiomatic Dart. If Box<T> holds a numeric type (int or double),
you can mathematically interact with the Box natively without unboxing it explicitly.
Constructors
- Box(T value)
-
Creates a Box encapsulating the provided
value.
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value ↔ T
-
The underlying value held inside the box.
getter/setter pair
Methods
-
call(
) → T - Unboxes the value implicitly when called functionally.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator %(
dynamic other) → dynamic - Modulo operator.
-
operator *(
dynamic other) → dynamic - Multiplies a value or another box algebraically.
-
operator +(
dynamic other) → dynamic - Adds a value or another box algebraically.
-
operator -(
dynamic other) → dynamic - Subtracts a value or another box algebraically.
-
operator /(
dynamic other) → dynamic - Divides a value or another box algebraically.
-
operator <(
dynamic other) → bool - Less than comparison.
-
operator <=(
dynamic other) → bool - Less than or equal comparison.
-
operator ==(
Object other) → bool -
Standard equivalence checking.
override
-
operator >(
dynamic other) → bool - Greater than comparison.
-
operator >=(
dynamic other) → bool - Greater than or equal comparison.
-
operator ~/(
dynamic other) → dynamic - Integer Division operator.