wrap method

SliverOffset wrap(
  1. Offset offset,
  2. Size size
)

Returns the sliver offset given a regular offset and size.

Implementation

SliverOffset wrap(Offset offset, Size size) {
  switch (axis) {
    case Axis.horizontal:
      final main = growsReverse ? size.width - offset.dx : offset.dx;
      return SliverOffset(offset.dx, offset.dy, offset.dx, main);
    case Axis.vertical:
      final main = growsReverse ? size.height - offset.dy : offset.dy;
      return SliverOffset(offset.dx, offset.dy, offset.dy, main);
  }
}