unwrap method

SliverOffset unwrap(
  1. double cross,
  2. double main,
  3. Size size
)

Returns the relative offset given a cross position, main position, and size.

Implementation

SliverOffset unwrap(double cross, double main, Size size) {
  switch (axis) {
    case Axis.horizontal:
      if (growsReverse) {
        main = size.width - main;
      }
      return SliverOffset(main, cross, cross, main);
    case Axis.vertical:
      if (growsReverse) {
        main = size.height - main;
      }
      return SliverOffset(cross, main, cross, main);
  }
}