direction static method

Offset direction(
  1. AxisDirection direction,
  2. double cross,
  3. double main
)

Creates an offset where main is the extent on direction and cross is the extent counter-clockwise to direction.

Implementation

static Offset direction(AxisDirection direction, double cross, double main) {
  if (direction == AxisDirection.up) {
    return Offset(cross, -main);
  } else if (direction == AxisDirection.right) {
    return Offset(main, -cross);
  } else if (direction == AxisDirection.down) {
    return Offset(cross, main);
  } else {
    return Offset(-main, cross);
  }
}