v1.0.2time_picker_spinner
使用旋转按钮代替默认的 Material 时钟选择器。此控件支持 12 小时或 24 小时格式以及自定义间隔模式,该包支持阿拉伯语和英语的本地化。
9喜欢 2700近 30 天下载140Pub 分数
AndroidiOSWebmacOSWindowsLinux
使用旋转按钮代替默认的 Material 时钟选择器。此控件支持 12 小时或 24 小时格式以及自定义间隔模式,该包支持阿拉伯语和英语的本地化。
{"sdk":"flutter"}{"sdk":"flutter"}—以下为英文项目原文快照,最新内容请访问 GitHub。
Time Picker with spinner instead of a default material time picker. This widget works with 12 or 24 hour format and custom interval mode, and this package allow localization ar and en.
image
pubspec.yaml file:dependencies:
time_picker_spinner: any
$ pub get
time_picker_spinner.dart file in your appimport 'package:time_picker_spinner/time_picker_spinner.dart';
| en short | en long |
|---|
image | image
TimePickerSpinner(
locale: const Locale('en', ''),
time: dateTime,
is24HourMode: false,
isShowSeconds: true,
itemHeight: 80,
normalTextStyle: const TextStyle(
fontSize: 24,
),
highlightedTextStyle:
const TextStyle(fontSize: 24, color: Colors.blue),
isForce2Digits: true,
onTimeChange: (time) {
setState(() {
dateTime = time;
});
},
)
| ar short | ar long |
|---|
image | image
TimePickerSpinner(
locale: const Locale('ar', ''),
time: dateTime,
is24HourMode: false,
isShowSeconds: true,
itemHeight: 80,
normalTextStyle: const TextStyle(
fontSize: 24,
),
highlightedTextStyle:
const TextStyle(fontSize: 24, color: Colors.blue),
isForce2Digits: true,
onTimeChange: (time) {
setState(() {
dateTime = time;
});
},
)
| props | types | defaultValues |
|---|---|---|
| time | DateTime | Current Time [ DateTime.now() ] |
| minutesInterval | int | 1 |
| secondsInterval | int | 1 |
| is24HourMode | bool | true |
| isShowSeconds | bool | false |
| isShowSeconds | bool | false |
| highlightedTextStyle | TextStyle | false |
| normalTextStyle | TextStyle | false |
| itemHeight | double | 60.0 |
| itemWidth | double | 45.0 |
| spacing | double | 20.0 |
| alignment | AlignmentGeometry | Alignment.centerRight |
| isForce2Digits | bool | false |
| onTimeChange | TimePickerCallback | |
| locale | bool | en |