gestures property

Implementation

Map<Type, GestureRecognizerFactory> get gestures {
  final DeviceGestureSettings? gestureSettings =
      MediaQuery.maybeOf(context)?.gestureSettings;
  return {
    TapGestureRecognizer:
        GestureRecognizerFactoryWithHandlers<TapGestureRecognizer>(
            () => TapGestureRecognizer(), (instance) {
      instance
        ..onTap = editing && !editController.isAnimating ||
                currentOffset.dx != 0.0
            ? () {
                if (editing && !editController.isAnimating) {
                  assert(
                      widget.index != null,
                      "From SwipeActionCell:\nIf you want to enter edit mode,please pass the 'index' parameter in SwipeActionCell\n"
                      "=====================================================================================\n"
                      "如果你要进入编辑模式,请在SwipeActionCell中传入index 参数,他的值就是你列表组件的itemBuilder中返回的index即可");

                  if (selected) {
                    widget.controller?.selectedSet.remove(widget.index);
                    _updateControllerSelectedIndexChangedCallback(
                        selected: false);
                  } else {
                    widget.controller?.selectedSet.add(widget.index!);
                    _updateControllerSelectedIndexChangedCallback(
                        selected: true);
                  }
                  setState(() {});
                } else if (currentOffset.dx != 0 && !controller.isAnimating) {
                  closeWithAnim();
                  _closeNestedAction();
                }
              }
            : null
        ..gestureSettings = gestureSettings;
    }),
    if (widget.isDraggable)
      _DirectionDependentDragGestureRecognizer:
          GestureRecognizerFactoryWithHandlers<
                  _DirectionDependentDragGestureRecognizer>(
              () => _DirectionDependentDragGestureRecognizer(), (instance) {
        instance
          ..onStart = _onHorizontalDragStart
          ..onUpdate = _onHorizontalDragUpdate
          ..onEnd = _onHorizontalDragEnd
          ..gestureSettings = gestureSettings
          ..isActionShowing =
              whenTrailingActionShowing || whenLeadingActionShowing
          ..canDragToLeft = hasTrailingAction
          ..canDragToRight = hasLeadingAction;
      }),
  };
}