SpacingRelative class

A spacing unit that represents a spacing relative to the parent size.

This spacing unit calculates its value as a fraction of the parent's viewport size along the specified axis. For example, a factor of 0.5 results in spacing equal to 50% of the parent's size.

Implemented types
Available extensions

Constructors

SpacingRelative(double factor)
Creates a relative spacing unit with the specified factor.
const

Properties

factor double
The relative factor (0.0 to 1.0) of the parent's size.
final
hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

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 actual spacing value.
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).