搜索插件、代码仓与 APP 分类

action_slider 封面
插件详情v0.7.0

action_slider

一个滑块,用于确认操作,并在后续加载后提供这些操作成功的反馈。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
2.4万
喜欢数
426
Pub 分数
150

安装插件

flutter pub add action_slider

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Action Slider 是一个 Flutter 小部件,允许用户通过滑动来确认操作,并在加载状态后提供成功时的视觉反馈。它通过结合基于手势的确认与清晰的成功指示器,增强了用户交互,改善了删除项目或提交表单等关键操作的体验。该滑块支持多个平台,并可无缝集成到现有 UI 中,具有可自定义的样式和行为。

适合场景

  • 确认破坏性操作
  • 提交表单时进行用户意图验证
  • 在设置或个人资料管理中提升用户体验
  • 在操作执行后提供反馈
  • 在移动和网页应用中集成基于手势的确认

主要特点

  • 基于手势的操作确认
  • 成功时的视觉反馈
  • 加载状态集成
  • 跨平台支持(Android、iOS、Web、macOS、Windows、Linux)
  • 可自定义的外观和行为

适合对象

  • 开发交互式表单的开发者
  • 需要用户确认敏感操作的应用程序
  • 以用户体验为中心的应用程序
  • 跨平台 Flutter 项目
  • 强调直观手势的设计系统

使用建议

  • 需要仔细处理加载状态
  • 可能需要为屏幕阅读器进行无障碍功能增强
  • 不适合简单的按钮点击
  • 仅限需要用户明确确认的使用场景
  • 复杂动画可能带来的性能影响

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

pub.dev github likes downloads 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 fully customizable slider to confirm actions and provide feedback on the success. It supports different states like loading, success and failure.

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
action_slider_example_expanded

ActionSlider.dual()
action_slider_example_dual
action_slider_example_dual_customized

ActionSlider.standard() with TextDirection.rtl
action_slider_example_rtl

ActionSlider.standard() with SliderIconAnimation.roll
action_slider_example_rolling

ActionSlider.standard() with SliderBehavior.stretch and SliderIconAnimation.roll
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
)

Two directions with ActionSlider.dual

ActionSlider.dual(
    child: const Text('Slide to confirm'),
    startAction: (controller) async {
        controller.success(expanded: true, side: SliderSide.start); //starts success animation with an expanded slider
    },
    endAction: (controller) async {
        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
)

所属分类

源码仓库

使用此插件的项目