axisDirectionIsReversed function

bool axisDirectionIsReversed (AxisDirection axisDirection)

Returns whether travelling along the given axis direction visits coordinates along that axis in numerically decreasing order.

Specifically, returns true for AxisDirection.up and AxisDirection.left and false for AxisDirection.down and AxisDirection.right.


bool axisDirectionIsReversed(AxisDirection axisDirection) {
  assert(axisDirection != null);
  switch (axisDirection) {
    case AxisDirection.up:
    case AxisDirection.left:
      return true;
    case AxisDirection.down:
    case AxisDirection.right:
      return false;
  return null;