getPointFromGestureDetail static method

Offset getPointFromGestureDetail(
  1. dynamic gestureDetail
)

Implementation

static Offset getPointFromGestureDetail(dynamic gestureDetail) {
  switch (gestureDetail.runtimeType) {
    case TapDownDetails:
      return (gestureDetail as TapDownDetails).localPosition;
    case TapUpDetails:
      return (gestureDetail as TapUpDetails).localPosition;
    case DragDownDetails:
      return (gestureDetail as DragDownDetails).localPosition;
    case DragStartDetails:
      return (gestureDetail as DragStartDetails).localPosition;
    case DragUpdateDetails:
      return (gestureDetail as DragUpdateDetails).localPosition;
    case LongPressStartDetails:
      return (gestureDetail as LongPressStartDetails).localPosition;
    case LongPressEndDetails:
      return (gestureDetail as LongPressEndDetails).localPosition;
    case LongPressMoveUpdateDetails:
      return (gestureDetail as LongPressMoveUpdateDetails).localPosition;
    case ScaleStartDetails:
      return (gestureDetail as ScaleStartDetails).localFocalPoint;
    case ScaleUpdateDetails:
      return (gestureDetail as ScaleUpdateDetails).localFocalPoint;
    case ForcePressDetails:
      return (gestureDetail as ForcePressDetails).localPosition;
    default:
      throw Exception(
          "gestureDetail.runTimeType = ${gestureDetail.runtimeType} is not recognized ! ");
  }
}