getAbsoluteSizeRelativeToOrigin method

  1. @protected
Size getAbsoluteSizeRelativeToOrigin()

This returns a Size with dimensions relative to the leading edge of the sliver, specifically the same offset that is given to the paint method. This means that the dimensions may be negative.

This is only valid after layout has completed.

See also:

Implementation

@protected
Size getAbsoluteSizeRelativeToOrigin() {
  assert(geometry != null);
  assert(!debugNeedsLayout);
  return switch (applyGrowthDirectionToAxisDirection(constraints.axisDirection, constraints.growthDirection)) {
    AxisDirection.up    => Size(constraints.crossAxisExtent, -geometry!.paintExtent),
    AxisDirection.down  => Size(constraints.crossAxisExtent,  geometry!.paintExtent),
    AxisDirection.left  => Size(-geometry!.paintExtent, constraints.crossAxisExtent),
    AxisDirection.right => Size(geometry!.paintExtent,  constraints.crossAxisExtent),
  };
}