map<T> method

T map<T>({
  1. required T tap(
    1. NvGestureTap
    ),
  2. required T drag(
    1. NvGestureDrag
    ),
  3. bool apply = true,
})

Implementation

T map<T>({
  required T Function(NvGestureTap) tap,
  required T Function(NvGestureDrag) drag,
  bool apply = true,
}) {
  if (this is NvGestureTap) {
    return tap(this as NvGestureTap);
  } else if (this is NvGestureDrag) {
    return drag(this as NvGestureDrag);
  }
  throw Exception('Gesture not registered with NvGesture.map function');
}