搜尋套件、儲存庫與 APP 分類

套件詳情v0.2.9

slide_button

一個基於多個裝置滑動解鎖功能的滑動Flutter元件。高度可自訂且彈性。

近 30 天下載
36
喜歡數
33
Pub 分數
40

安裝套件

flutter pub add slide_button

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

SlideButton 是一個可自訂的 Flutter 小部件,靈感來自於各種裝置上的「滑動解鎖」功能。它提供流暢、互動式的滑動體驗,並具備豐富的顏色、形狀與動畫樣式選項。開發者可以根據需求調整其外觀與行為,非常適合用於驗證提示、切換按鈕或吸引使用者的互動情境。此小部件輕巧且容易整合至現有的 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.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。