赞
踩
showDatePicker:封装了YearPicker和MonthPicker的联动控件
CupertinoDatePicker:IOS风格日期选择器
showTimePicker:通过回调方式启动时间选择器
CupertinoTimerPicker:IOS风格时间选择器
DayPicker({
Key? key,
required this.selectedDate,
required this.currentDate,
required this.onChanged,
required this.firstDate,
required this.lastDate,
required this.displayedMonth,
this.selectableDayPredicate,
this.dragStartBehavior = DragStartBehavior.start,
})
| 属性 | 说明 | 取值 |
| :-: | :-: | :-: |
| selectedDate | 选中后高亮显示日期 | DateTime |
| currentDate | 当前日期 | DateTime |
| onChanged | 用户选择日期函数 | ValueChanged |
| firstDate | 允许选择的开始日期 | DateTime |
| lastDate | 允许选择的结束日期 | DateTime |
| displayedMonth | 展示日期 | DateTime |
| selectableDayPredicate | 用户的可选日期 | SelectableDayPredicate |
DateTime _selectedDate = DateTime.now();
Text(“DayPicker-示例”),
Flexible(
child: DayPicker(
selectableDayPredicate: (date) {return date.difference(DateTime.now()).
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。