SpacingCalculated class
A spacing unit that performs calculations between two other spacing units.
Similar to SizeCalculated and PositionCalculated, this allows creating complex spacing expressions by combining different spacing units with mathematical operations.
- Implemented types
- Available extensions
Constructors
- SpacingCalculated(SpacingUnit first, SpacingUnit second, CalculationOperation operation)
-
Creates a calculated spacing unit from two operands and an operation.
const
Properties
- first → SpacingUnit
-
The first operand in the calculation.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- operation → CalculationOperation
-
The mathematical operation to perform.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- second → SpacingUnit
-
The second operand in the calculation.
final
Methods
-
clamp(
{SpacingUnit min = const SpacingFixed(0), SpacingUnit max = const SpacingFixed(double.infinity)}) → SpacingUnit -
Available on SpacingUnit, provided by the SpacingUnitExtension extension
Constrains this spacing unit within the specified min and max bounds. -
computeSpacing(
{required ParentLayout parent, required LayoutAxis axis, required double viewportSize}) → double -
Computes the spacing 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 -
Returns a code string representation of this spacing unit.
override
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator *(
Object other) → SpacingUnit -
Available on SpacingUnit, provided by the SpacingUnitExtension extension
Multiplies two spacing units. -
operator +(
SpacingUnit other) → SpacingUnit -
Available on SpacingUnit, provided by the SpacingUnitExtension extension
Adds two spacing units together. -
operator -(
SpacingUnit other) → SpacingUnit -
Available on SpacingUnit, provided by the SpacingUnitExtension extension
Subtracts one spacing unit from another. -
operator /(
SpacingUnit other) → SpacingUnit -
Available on SpacingUnit, provided by the SpacingUnitExtension extension
Divides one spacing unit by another. -
operator ==(
Object other) → bool -
The equality operator.
override
-
operator unary-(
) → SpacingUnit -
Available on SpacingUnit, provided by the SpacingUnitExtension extension
Negates this spacing unit (equivalent to 0 - this).