flipAxisDirection function

AxisDirection flipAxisDirection(
  1. AxisDirection axisDirection
)

Returns the opposite of the given AxisDirection.

Specifically, returns AxisDirection.up for AxisDirection.down (and vice versa), as well as AxisDirection.left for AxisDirection.right (and vice versa).

See also:

Implementation

AxisDirection flipAxisDirection(AxisDirection axisDirection) {
  return switch (axisDirection) {
    AxisDirection.up    => AxisDirection.down,
    AxisDirection.right => AxisDirection.left,
    AxisDirection.down  => AxisDirection.up,
    AxisDirection.left  => AxisDirection.right,
  };
}