action_slider

v0.7.0

A slider to confirm actions and provide feedback on the success of these after subsequent loading.

Package archive: https://pubdev.letsnova.ru/api/archives/action_slider/0.7.0.tar.gz

Installdart pub add action_slider

Readme

pub.dev github likes popularity pub points license

buy me a coffee

If you like this package, please leave a like there on pub.dev and star on GitHub.

A slider to confirm actions and provide feedback on the success of these after subsequent loading.
LTR and RTL are both supported.
For a switch with a similar look, you can check out animated_toggle_switch.

Examples

ActionSlider.standard() with SliderBehavior.stretch
action_slider_example_snake

ActionSlider.standard() with TextDirection.rtl
action_slider_example_rtl

ActionSlider.dual()
action_slider_example_dual

ActionSlider.standard() with rolling = true
action_slider_example_rolling

ActionSlider.standard() with SliderBehavior.stretch and rolling = true
action_slider_example_rolling_snake

You can build your own sliders with ActionSlider.custom()
action_slider_example_custom

Easy Usage

Easy to use and highly customizable.

ActionSlider.standard(
                    child: const Text('Slide to confirm'),
                    action: (controller) async {
                        controller.loading(); //starts loading animation
                        await Future.delayed(const Duration(seconds: 3));
                        controller.success(); //starts success animation
                    },
                    ... //many more parameters
                )
                

Maximum customizability with ActionSlider.custom.

ActionSlider.custom(
                    foregroundBuilder: (context, state, child) => ...,
                    backgroundBuilder: (context, state, child) => ...,
                    outerBackgroundBuilder: (context, state, child) => ...,
                    action: (controller) => ...,
                    ... //many more parameters
                )
                

Changelog

0.7.0 [2023-07-30]

  • BREAKING: increases minimum SDK to 2.17
  • BREAKING: changes default background color from ThemeData.backgroundColor to ThemeData.cardColor
  • BREAKING: changes state type of ActionSliderController from SliderMode to ActionSliderControllerState
  • adds anchorPosition and allowedInterval to ActionSliderController
  • adds anchorPosition and allowedInterval to SliderState
  • adds ActionSliderController.dual
  • closes #6

0.6.1 [2022-12-09]

  • adds support for RTL
  • adds direction to constructors

0.6.0 [2022-07-05]

  • minor fixes
  • fixes #1
  • BREAKING: renames onSlide to action in ActionSlider.standard

0.5.0 [2022-03-17]

  • adds stateChangeCallback, actionThreshold and actionThresholdType
  • BREAKING: renames onSlide to action
  • BREAKING: renames SlideCallback to Action

0.4.0 [2022-03-17]

  • major customizability improvements
  • adds outerBackgroundBuilder and outerBackgroundChild to constructor ActionSlider.custom
  • adds crossFadeDuration, customBackgroundBuilder, customBackgroundBuilderChild , customOuterBackgroundBuilder and customOuterBackgroundBuilderChild to constructor ActionSlider.standard
  • BREAKING: renames SlidingState.loading to SlidingState.compact
  • BREAKING: renames CrossFade to SliderCrossFade
  • BREAKING change for constructor ActionSlider.standard:
    • removes circleRadius and adds borderWidth instead
  • BREAKING change for constructor ActionSlider.custom:
    • removes toggleHeight and adds toggleMargin instead

0.3.0 [2022-03-12]

  • adds onTap parameter
  • adds jump method to ActionSliderController
  • minor gesture detection improvements

0.2.1 [2022-02-28]

  • changes README.md

0.2.0 [2022-02-28]

  • BREAKING: changes parameters of ForegroundBuilder and BackgroundBuilder
  • adds SliderBehaviour.stretch

0.1.2 [2022-02-25]

  • BREAKING: changes parameters of SlideCallback
  • optimizes fade animation

0.1.1 [2022-02-21]

  • fixes README.md

0.1.0 [2022-02-21]

  • initial release