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

numeric_selector 封面
套件詳情v0.0.4

numeric_selector

適用於 Flutter 的可自訂數字選擇器小部件,支援垂直和水平捲動。

AndroidiOS
近 30 天下載
83
喜歡數
11
Pub 分數
160

安裝套件

flutter pub add numeric_selector

套件介紹

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

一個可自定義的數字選擇器元件,適用於 Flutter,允許使用者透過垂直或水平滾動來選擇數字。它提供順暢、互動式的滾動功能,支援設定步長、範圍限制與視覺樣式。非常適合需要精確數值輸入但不需要傳統文字欄位的設定情境。此元件輕量且能無縫整合至表單或設定畫面中。

適用情境

  • 需要精確數字選擇的表單輸入
  • 可調節值的設定面板
  • 儀表板中的自訂數字選擇器
  • 需要觸控友善數字輸入的移動UI
  • 時間或數量配置介面

主要特色

  • 支援垂直和水平捲動
  • 可設定的步幅與數值範圍
  • 可自定義的外觀和樣式
  • 平滑滾動動畫
  • 內建值驗證
  • 可擴展以支援自訂行為

適合對象

  • 開發基於表單應用程式的開發者
  • 需要直覺式數值輸入的設計人員
  • 需要觸控優化數字選擇的應用程式
  • 依賴最少的專案
  • 針對 Android 和 iOS 的 Flutter 應用

使用建議

  • 僅限數字輸入
  • 無內建鍵盤整合
  • 需要手動處理大數值範圍
  • 不適用於非整數值,除非進行自訂
  • 可能需要額外的樣式以滿足高對比度可訪問性要求

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Numeric Selector

A customizable Numeric Selector package for Flutter, providing both Horizontal and Vertical Numeric Selector with smooth scrolling and optional vibration feedback.

Features

✅ Horizontal and Vertical pickers
✅ Customizable styles and colors
✅ Vibration feedback support
✅ Supports minimum, maximum, and step values
✅ Optional labels and arrow indicators

Installation

Add the following dependency to your pubspec.yaml file:

dependencies:
  numeric_selector: latest_version

Then, run:

flutter pub get

Demo

Horizontal Numeric Selector Vertical Numeric Selector
Horizontal Numeric Selector Vertical Numeric Selector

Usage

Horizontal Numeric Selector
HorizontalNumericSelector(
  minValue: 0,
  maxValue: 100,
  step: 1,
  initialValue: 50,
  onValueChanged: (value) {
    print("Selected Value: $value");
  },
  viewPort: 0.3,
  selectedTextStyle: TextStyle(fontSize: 32, fontWeight: FontWeight.bold),
  unselectedTextStyle: TextStyle(fontSize: 24, color: Colors.grey),
  backgroundColor: Colors.white,
  showLabel: true,
  label: "Quantity",
  showArrows: true,
  enableVibration: true,
)
Vertical Numeric Selector
VerticalNumericSelector(
  minValue: 1,
  maxValue: 10,
  step: 1,
  initialValue: 5,
  onValueChanged: (value) {
    print("Selected Value: $value");
  },
  viewPort: 0.3,
  selectedTextStyle: TextStyle(fontSize: 32, fontWeight: FontWeight.bold),
  unselectedTextStyle: TextStyle(fontSize: 24, color: Colors.grey),
  backgroundColor: Colors.white,
  borderRadius: BorderRadius.circular(10),
  showLabel: true,
  label: "Speed",
  showArrows: true,
  enableVibration: true,
)

Parameters

Parameter Type Description
minValue int Minimum selectable value
maxValue int Maximum selectable value
step int Step between values
initialValue int Default selected value
onValueChanged ValueChanged<int> Callback when value changes
viewPort double Fraction of viewport occupied by picker
selectedTextStyle TextStyle? Style for selected value
unselectedTextStyle TextStyle? Style for unselected values
backgroundColor Color? Background color
borderRadius BorderRadius? Corner radius for picker background
showLabel bool Show label text below selected value
label String? Custom label text
showArrows bool Show navigation arrows
arrowIcon IconData? Custom arrow icon
enableVibration bool Enable vibration feedback

Contributing

Contributions are welcome! Feel free to submit a PR or open an issue.

Contact

👤 Amirmahdi Nourkazemi
LinkedIn

License

This project is licensed under the MIT License.

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案