搜索插件、代码仓与 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 项

源码仓库

使用此插件的项目