toAxisDirection method

AxisDirection toAxisDirection()

Implementation

AxisDirection toAxisDirection() {
  if (dx.abs() >= dy.abs()) {
    if (dx.isNegative) {
      return AxisDirection.left;
    }
    return AxisDirection.right;
  }
  if (dy.isNegative) {
    return AxisDirection.up;
  }
  return AxisDirection.down;
}