updatePosition method

void updatePosition(
  1. dynamic details
)

Implementation

void updatePosition(details) {
  if (details is DragEndDetails) {
    setState(() {
      _duration = 600;
      if (widget.stickToEnd && _position > widget.width - widget.height) {
        _position = widget.width - widget.height;
      } else {
        _position = 0;
      }
    });
  } else if (details is DragUpdateDetails) {
    setState(() {
      _duration = 0;
      _position = details.localPosition.dx - (widget.height / 2);
    });
  }
}