PositionRelative class
A position unit that represents a position relative to the parent size.
This position unit calculates its value as a fraction of the parent's viewport size along the specified axis. For example, a factor of 0.5 positions the element at 50% of the parent's size.
- Inheritance
-
- Object
- PositionUnit
- PositionRelative
- Available extensions
Constructors
- PositionRelative(double factor)
-
Creates a relative position unit with the specified
factor.const
Properties
Methods
-
clamp(
{PositionUnit min = const PositionFixed(double.negativeInfinity), PositionUnit max = const PositionFixed(double.infinity)}) → PositionUnit -
Available on PositionUnit, provided by the PositionUnitExtension extension
Constrains this position unit within the specified min and max bounds. -
computePosition(
{required ParentLayout parent, required ChildLayout child, required LayoutAxis direction}) → double -
Computes the actual position value for this unit.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
times(
double other) → PositionUnit -
Available on PositionUnit, provided by the PositionUnitExtension extension
Multiplies a position unit by a scalar. -
toCodeString(
) → String -
Converts the position unit to a code string representation.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator *(
Object other) → PositionUnit -
Available on PositionUnit, provided by the PositionUnitExtension extension
Multiplies two position units. -
operator +(
PositionUnit other) → PositionUnit -
Available on PositionUnit, provided by the PositionUnitExtension extension
Adds two position units together. -
operator -(
PositionUnit other) → PositionUnit -
Available on PositionUnit, provided by the PositionUnitExtension extension
Subtracts one position unit from another. -
operator /(
PositionUnit other) → PositionUnit -
Available on PositionUnit, provided by the PositionUnitExtension extension
Divides one position unit by another. -
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator unary-(
) → PositionUnit -
Available on PositionUnit, provided by the PositionUnitExtension extension
Negates this position unit (equivalent to 0 - this).