v0.7.0action_slider
一个滑块,用于确认操作,并在后续加载后提供这些操作成功的反馈。
一个 Flutter 滑块,用于确认操作并在后续加载后提供成功反馈。
以下为英文项目原文快照,最新内容请访问 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.
ActionSlider.standard() with SliderBehavior.stretch
ActionSlider.dual()
ActionSlider.standard() with TextDirection.rtl
ActionSlider.standard() with SliderIconAnimation.roll
ActionSlider.standard() with SliderBehavior.stretch and SliderIconAnimation.roll
You can build your own sliders with ActionSlider.custom()
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
)
依赖清单 4 项
{"sdk":"flutter"}{"sdk":"flutter"}^4.0.0^8.0.13先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗