滚动小时时如何禁用更改分钟?
方法
Widget time() {
return CupertinoTimerPicker(
mode: CupertinoTimerPickerMode.hm,
minuteInterval: 1,
secondInterval: 1,
initialTimerDuration: initialtimer,
onTimerDurationChanged: (Duration changedtimer) {
setState(() {
initialtimer = changedtimer;
});
},
);
}
小部件上的通话时间()
child: MaterialButton(
child: Align(
alignment: Alignment.centerLeft,
如果初始计时器值0显示提示(那是错误的代码吗?)
child: initialtimer.inHours == 0 && initialtimer.inMinutes == 0
? Text('Hours : Minutes')
: Text(
"${initialtimer.inHours} : ${initialtimer.inMinutes}"),
),
onPressed()
onPressed: () {
showModalBottomSheet(
context: context,
builder: (BuildContext builder) {
return Container(
height: MediaQuery.of(context)
.copyWith()
.size
.height /
3,
child: time());
});
},
),