getCurrentDirection function

Direction getCurrentDirection (
  1. Offset p1,
  2. Offset p2
)

Implementation

Direction getCurrentDirection(Offset p1, Offset p2) {
  var xRes = (p1.dx - p2.dx).abs();
  var yRes = (p1.dy - p2.dy).abs();
  return xRes >= yRes ? Direction.X : Direction.Y;
}