splashbyte / action_slider

A Flutter slider to confirm actions and provide feedback on the success of these after subsequent loading.
BSD 3-Clause "New" or "Revised" License
33 stars 12 forks source link

Standard slider will crash when setting height to less than 60 #4

Closed RBmint closed 1 year ago

RBmint commented 1 year ago

return ActionSlider.standard( sliderBehavior: SliderBehavior.stretch, height: 59.w, width: 330.w, backgroundColor: Colors.white, toggleColor: Colors.blueAccent, action: (controller) async { controller.loading(); //starts loading animation await Future.delayed(const Duration(seconds: 2)); controller.success(); //starts success animation await Future.delayed(const Duration(seconds: 2)); controller.reset(); //resets the slider }, child: const Text('Slide to confirm'), );

this is a pretty basic slider, and the following error will be thrown when the slide is complete. ======== Exception caught by widgets library ======================================================= The following ArgumentError was thrown building AnimatedBuilder(listenable: AnimationController#b8034(◀ 1.000)➩Cubic(0.42, 0.00, 0.58, 1.00), state: _AnimatedState#e42b6): Invalid argument(s): 0.0

However, everything will work perfectly if the height it set to be greater than 60.

RBmint commented 1 year ago

This was due to the size extension file, e.g. height: 59.w which cause the issue