示例#1
0
 void _handleDragStart(DragStartDetails details)
 {
     if (widget.onDragStart != null)
     {
         widget.onDragStart(details);
     }
 }
示例#2
0
 void _handleDragStart(DragStartDetails details)
 {
     D.assert(_drag == null);
     _drag = position.drag(details, _disposeDrag);
     D.assert(_drag != null);
     D.assert(_hold == null);
 }
示例#3
0
 void _handleDragStart(DragStartDetails details)
 {
     D.assert(this._drag == null);
     this._drag = this.position.drag(details, this._disposeDrag);
     D.assert(this._drag != null);
     D.assert(this._hold == null);
 }
示例#4
0
 void _handleMouseDragSelectionStart(DragStartDetails details)
 {
     this._renderEditable.selectPositionAt(
         from: details.globalPosition,
         cause: SelectionChangedCause.drag
         );
 }
示例#5
0
文件: switch.cs 项目: JC-ut0/CubeGame
 void _handleDragStart(DragStartDetails details)
 {
     if (this.isInteractive)
     {
         this.reactionController.forward();
     }
 }
示例#6
0
        public ScrollDragController(
            ScrollActivityDelegate del          = null,
            DragStartDetails details            = null,
            VoidCallback onDragCanceled         = null,
            double?carriedVelocity              = null,
            double?motionStartDistanceThreshold = null
            )
        {
            D.assert(del != null);
            D.assert(details != null);
            D.assert(
                motionStartDistanceThreshold == null || motionStartDistanceThreshold > 0.0,
                "motionStartDistanceThreshold must be a positive number or null"
                );

            this._del                        = del;
            this._lastDetails                = details;
            this._retainMomentum             = carriedVelocity != null && carriedVelocity != 0.0;
            this._lastNonStationaryTimestamp = details.sourceTimeStamp;
            this._offsetSinceLastStop        = motionStartDistanceThreshold == null ? (double?)null : 0.0;

            this.onDragCanceled  = onDragCanceled;
            this.carriedVelocity = carriedVelocity;
            this.motionStartDistanceThreshold = motionStartDistanceThreshold;
        }
示例#7
0
        void _handleDragStart(DragStartDetails details)
        {
            Size handleSize = widget.selectionControls.getHandleSize(
                widget.renderObject.preferredLineHeight
                );

            _dragPosition = details.globalPosition + new Offset(0.0f, -handleSize.height);
        }
示例#8
0
 void _handleDragStart(DragStartDetails details)
 {
     if (isInteractive)
     {
         needsPositionAnimation = false;
         _reactionController.forward();
     }
 }
 public ScrollStartNotification(
     ScrollMetrics metrics        = null,
     BuildContext context         = null,
     DragStartDetails dragDetails = null
     ) : base(metrics: metrics, context: context)
 {
     this.dragDetails = dragDetails;
 }
示例#10
0
 void _handleDragSelectionUpdate(DragStartDetails startDetails,
                                 DragUpdateDetails updateDetails)
 {
     this._renderParagragh.selectPositionAt(
         from: startDetails.globalPosition,
         to: updateDetails.globalPosition,
         cause: SelectionChangedCause.drag);
 }
示例#11
0
 void _handleDragStart(DragStartDetails details)
 {
     D.assert(this._lastDragStartDetails == null);
     this._lastDragStartDetails = details;
     if (this.widget.onDragSelectionStart != null)
     {
         this.widget.onDragSelectionStart(details);
     }
 }
示例#12
0
 void _onPanStart(DragStartDetails details)
 {
     if (_lockScroll)
     {
         return;
     }
     _currentValue = _animationController.value;
     _currentPos   = widget.scrollDirection == Axis.horizontal
         ? details.globalPosition.dx
         : details.globalPosition.dy;
 }
        public override Drag drag(DragStartDetails details, VoidCallback dragCancelCallback)
        {
            ScrollDragController drag = new ScrollDragController(
                del: this,
                details: details,
                onDragCanceled: dragCancelCallback,
                carriedVelocity: this.physics.carriedMomentum(this._heldPreviousVelocity),
                motionStartDistanceThreshold: this.physics.dragStartDistanceMotionThreshold
                );

            this.beginActivity(new DragScrollActivity(this, drag));
            D.assert(this._currentDrag == null);
            this._currentDrag = drag;
            return(drag);
        }
示例#14
0
        void _handleDragStart(DragStartDetails details)
        {
            this._dragUnderway = true;
            this.widget.controller?.setActiveState(this);
            this._dragExtent = this._actionsMoveController.value * this._actionsDragAxisExtent *
                               this._dragExtent.sign();
            if (this._overallMoveController.isAnimating)
            {
                this._overallMoveController.stop();
            }

            if (this._actionsMoveController.isAnimating)
            {
                this._actionsMoveController.stop();
            }
        }
示例#15
0
        void _handleDragStart(DragStartDetails details)
        {
            this._dragUnderway = true;
            if (this._moveController.isAnimating)
            {
                this._dragExtent = this._moveController.value * this._overallDragAxisExtent * this._dragExtent.sign();
                this._moveController.stop();
            }
            else
            {
                this._dragExtent = 0.0f;
                this._moveController.setValue(0.0f);
            }

            this.setState(() => { this._updateMoveAnimation(); });
        }
示例#16
0
        void _handleDragStart(DragStartDetails details)
        {
            _dragUnderway = true;
            if (_moveController.isAnimating)
            {
                _dragExtent = _moveController.value * _overallDragAxisExtent * _dragExtent.sign();
                _moveController.stop();
            }
            else
            {
                _dragExtent = 0.0f;
                _moveController.setValue(0.0f);
            }

            setState(() => { _updateMoveAnimation(); });
        }
示例#17
0
        void _handleDragEnd(DragEndDetails details)
        {
            D.assert(this._lastDragStartDetails != null);
            if (this._lastDragUpdateDetails != null)
            {
                this._dragUpdateThrottleTimer.cancel();
                this._handleDragUpdateThrottled();
            }

            if (this.widget.onDragSelectionEnd != null)
            {
                this.widget.onDragSelectionEnd(details);
            }

            this._dragUpdateThrottleTimer = null;
            this._lastDragStartDetails    = null;
            this._lastDragUpdateDetails   = null;
        }
示例#18
0
    void _handleDragEnd(DragEndDetails details)
    {
        D.assert(_lastDragStartDetails != null);
        if (_lastDragUpdateDetails != null)
        {
            _dragUpdateThrottleTimer.cancel();
            _handleDragUpdateThrottled();
        }

        if (widget.onDragSelectionEnd != null)
        {
            widget.onDragSelectionEnd(details);
        }

        _dragUpdateThrottleTimer = null;
        _lastDragStartDetails    = null;
        _lastDragUpdateDetails   = null;
    }
示例#19
0
 void _onPanStart(DragStartDetails details)
 {
     _moveController.setValue(1.0f);
     _setDragOffset(Offset.zero);
 }
示例#20
0
 void _handleDragStart(DragStartDetails details)
 {
     D.assert(mounted);
     D.assert(_backGestureController == null);
     _backGestureController = widget.onStartPopGesture();
 }
示例#21
0
 void _handleDragStart(DragStartDetails details)
 {
     this._dragPosition = details.globalPosition +
                          new Offset(0.0f, -this.widget.selectionControls.handleSize.height);
 }
示例#22
0
 public abstract Drag drag(DragStartDetails details, VoidCallback dragCancelCallback);
示例#23
0
 void _handleDragStart(DragStartDetails details)
 {
     _startInteraction(details.globalPosition);
 }
示例#24
0
 public override Drag drag(DragStartDetails details, VoidCallback dragCancelCallback)
 {
     _dragCancelCallback = dragCancelCallback;
     return(base.drag(details, dragCancelCallback));
 }
示例#25
0
 void handleDragStart(DragStartDetails details)
 {
     animationCurve = Curves.linear;
 }