computeSpacing abstract method

double computeSpacing({
  1. required ParentLayout parent,
  2. required LayoutAxis axis,
  3. required double viewportSize,
})

Computes the actual spacing value.

Spacing units are computed during layout to determine margins, padding, or gaps between elements. The calculation considers the parent layout context, the axis direction, and the available viewport size.

Parameters:

  • parent: The parent layout providing context
  • axis: The axis along which spacing is calculated (LayoutAxis.horizontal or LayoutAxis.vertical)
  • viewportSize: The size of the viewport along the specified axis

Returns the computed spacing value in pixels.

Implementation

double computeSpacing({
  required ParentLayout parent,
  required LayoutAxis axis,
  required double viewportSize,
});