getAbsoluteSizeRelativeToOrigin method Null safety

  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:


Size getAbsoluteSizeRelativeToOrigin() {
  assert(geometry != null);
  switch (applyGrowthDirectionToAxisDirection(constraints.axisDirection, constraints.growthDirection)) {
    case AxisDirection.up:
      return Size(constraints.crossAxisExtent, -geometry!.paintExtent);
    case AxisDirection.right:
      return Size(geometry!.paintExtent, constraints.crossAxisExtent);
    case AxisDirection.down:
      return Size(constraints.crossAxisExtent, geometry!.paintExtent);
    case AxisDirection.left:
      return Size(-geometry!.paintExtent, constraints.crossAxisExtent);