flutter-slide-to-act
flutter-slide-to-act copied to clipboard
Bugfix: calculation of _maxDx
I noticed that _maxDx was calculated quite complicated and wrong if you change properties that effect the size of the sliding button.
_maxDx = _containerWidth! -
(sliderWidth / 2) -
40 -
widget.sliderButtonYOffset;
There is the hardcoded "40" and I noticed that sliderButtonYOffset (that should better be named sliderButtonXOffset ;) ) was just necessary because of a hardcoded horizontalPadding of 8 around the sliding button.
Therefore I did those changes and realized that the calculation of _maxDx becomes very simple:
_maxDx = _containerWidth! - sliderWidth;