constrainDelta method
Constrains an offset to the allowed direction.
Implementation
Offset constrainDelta(Offset delta) {
switch (this) {
case DragDirection.horizontal:
return Offset(delta.dx, 0);
case DragDirection.vertical:
return Offset(0, delta.dy);
case DragDirection.both:
return delta;
}
}