Material design风格的时间选择器

showTimePicker(
  context: context,
  initialTime: TimeOfDay.now(), //初始化显示时间
).then((timeOfDay) { //选择时间后点击OK拿到的时间结果
  if(timeOfDay == null) {
    return;
  }
  print('当前选择了:${timeOfDay.hour}时${timeOfDay.minute}分');
});

 

posted @ 2020-03-13 15:49  lai1322  阅读(426)  评论(0编辑  收藏  举报