IntExtension extension

Extension methods on int for convenient conversion to flexbox units.

This extension provides convenient getters to convert integer values into various flexbox unit types such as SizeUnit, PositionUnit, and SpacingUnit. It also provides utilities for percentage calculations and relative sizing.

Example:

final size = 100.size;  // Creates SizeUnit.fixed(100.0)
final position = 50.position;  // Creates PositionUnit.fixed(50.0)
final spacing = 10.spacing;  // Creates SpacingUnit.fixed(10.0)
on

Properties

percent double

Available on int, provided by the IntExtension extension

Converts an int value to a percentage (0.0 to 1.0).
no setter
position PositionUnit

Available on int, provided by the IntExtension extension

Converts an int value to a fixed PositionUnit.
no setter
relativeContentPosition PositionUnit

Available on int, provided by the IntExtension extension

Converts an int value to a content-size-relative PositionUnit.
no setter
relativePosition PositionUnit

Available on int, provided by the IntExtension extension

Converts an int value to a viewport-relative PositionUnit.
no setter
relativeSize SizeUnit

Available on int, provided by the IntExtension extension

Converts an int value to a viewport-relative SizeUnit.
no setter
relativeSpacing SpacingUnit

Available on int, provided by the IntExtension extension

Converts an int value to a viewport-relative SpacingUnit.
no setter
size SizeUnit

Available on int, provided by the IntExtension extension

Converts an int value to a SizeUnit.fixed instance.
no setter
spacing SpacingUnit

Available on int, provided by the IntExtension extension

Converts an int value to a fixed SpacingUnit.
no setter

Methods

relativeChildPosition([Key? key]) PositionUnit

Available on int, provided by the IntExtension extension

Converts an int value to a child-size-relative PositionUnit.