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

插件详情v0.2.9

slide_button

一个基于多个设备滑动解锁功能的滑动Flutter控件。高度可定制且灵活。

近 30 天下载
36
喜欢数
33
Pub 分数
40

安装插件

flutter pub add slide_button

插件介绍

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

SlideButton 是一个可自定义的 Flutter 小部件,灵感来源于各种设备上的“滑动以解锁”功能。它提供了流畅、交互式的滑动体验,并具有丰富的颜色、形状和动画样式选项。开发者可以将其外观和行为调整为满足各种 UI 需求,非常适合用于身份验证提示、开关控件或吸引用户的互动场景。该小部件轻量且易于集成到现有的 Flutter 项目中。

适合场景

  • 身份验证提示
  • 交互式 UI 元素
  • 自定义切换开关
  • 引导屏幕
  • 用户确认对话框

主要特点

  • 高度可定制的外观
  • 平滑滑动动画
  • 可配置的轨道和滑块样式
  • 支持滑动完成时的回调
  • 轻量且高效

适合对象

  • 开发直观的解锁界面的开发者
  • 寻求交互式小部件的设计人员
  • 需要用户确认操作的应用程序
  • 具有自定义滑块需求的项目

使用建议

  • 有限的平台特定行为
  • 无内置的可访问性功能
  • 需要手动处理边缘情况
  • 未针对复杂手势识别进行优化

原始 README

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

Sliding Button

A sliding Flutter widget, based on the slide to unlock function from multiple devices. Heavily customizable and flexible.

pls don't be a giant-ass gif

Installing

Add the following to your pubspec.yaml:

dependencies:
slide_button: ^0.2.8

Usage

  1. Install
  2. Use the SlideButton widget anywhere
  3. ???
  4. Profit

Properties

Several properties are present and can be customized:

| Properties              	| Description                                                                                                                                                            	|
|-------------------------	|------------------------------------------------------------------------------------------------------------------------------------------------------------------------	|
| height                  	| Height of the Widget, leave blank to get the parent constraints.                                                                                                       	|
| backgroundChild         	| A child to be put on the background bar, NOT centered by default.                                                                                                      	|
| slidingChild            	| A child tobe put on the sliding bar, NOT centered by default.                                                                                                          	|
| backgroundColor         	| The color of the background bar.                                                                                                                                       	|
| slidingBarColor         	| The color of the sliding bar.                                                                                                                                          	|
| confirmPercentage       	| How much of the bar width have to be slided to confirm the action.                                                                                                     	|
| initialSliderPercentage 	| The initial (and resting) percentage of the sliding bar.                                                                                                               	|
| isDraggable             	| Is this widget draggable?                                                                                                                                              	|
| onButtonSlide           	| Callback that returns a `Double` value containing the drag percentage.                                                                                                 	|
| onButtonOpened          	| Callback called when the button is slided all the way.                                                                                                                 	|
| onButtonClosed          	| Callback called when the button is back to the initialSliderPercentage.                                                                                                	|
| slideDirection          	| Either SlideDirection.RIGHT or SlideDirection.LEFT, sets the sliding direction of the sliding bar.                                                                     	|
| shouldCloseBorders      	| This updates the borders when the button reaches 0.9 percent dragged, and set the borderRadius to zero, giving the impression of a "closed" button. Defaults to `true` 	|
| shouldCloseBorders      	| BorderRadius for the sliding bar, default is 50. 	                                                                                                                        |

TODO

  • [x] Create the repo
  • [x] Make it work
  • [ ] Fix text on the sliding bar
  • [ ] Find a better activation function capable of activating between x and y percentages
  • [ ] More listeners?
  • [ ] Parallax effect?
  • [ ] Make it pop

Inspiration

This widget was partially made possible by inspecting elements from sliding_up_panel.

所属分类

源码仓库

使用此插件的项目

暂无相关数据。