SizeCalculated class
A size unit that performs calculations between two other size units.
This allows creating complex sizing expressions by combining different size units with mathematical operations. For example, you could create a size that is the sum of a fixed size and a percentage of viewport size.
The calculation is performed by first computing both operand sizes, then applying the operation to get the final result.
- Inheritance
- Available extensions
Constructors
- SizeCalculated(SizeUnit first, SizeUnit second, CalculationOperation operation)
-
Creates a calculated size unit with the specified operands and operation.
const
Properties
- first → SizeUnit
-
The first operand in the calculation.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- operation → CalculationOperation
-
The mathematical operation to perform.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- second → SizeUnit
-
The second operand in the calculation.
final
Methods
-
clamp(
{SizeUnit min = const SizeFixed(0), SizeUnit max = const SizeFixed(double.infinity)}) → SizeUnit -
Available on SizeUnit, provided by the SizeUnitExtension extension
Constrains this size unit within the specified min and max bounds. -
computeSize(
{required ParentLayout parent, required ChildLayout child, required LayoutHandle< Layout> layoutHandle, required LayoutAxis axis, required LayoutSize contentSize, required LayoutSize viewportSize}) → double -
Computes the size by calculating both operands and applying the operation.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toCodeString(
) → String -
Converts the size unit to a code string representation.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator *(
Object other) → SizeUnit -
Available on SizeUnit, provided by the SizeUnitExtension extension
Multiplies two size units. -
operator +(
SizeUnit other) → SizeUnit -
Available on SizeUnit, provided by the SizeUnitExtension extension
Adds two size units together. -
operator -(
SizeUnit other) → SizeUnit -
Available on SizeUnit, provided by the SizeUnitExtension extension
Subtracts one size unit from another. -
operator /(
SizeUnit other) → SizeUnit -
Available on SizeUnit, provided by the SizeUnitExtension extension
Divides one size unit by another. -
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator unary-(
) → SizeUnit -
Available on SizeUnit, provided by the SizeUnitExtension extension
Negates this size unit (equivalent to 0 - this).