尽管我的代码没有出错,但无法从我的日期选择器中获取日期。
Future selectDate() async {
DateTime picked = await showDatePicker(
context: context,
initialDate: new DateTime.now(),
firstDate: new DateTime(2016),
lastDate: new DateTime(2222));
if (picked != null) setState(() => picked = datepicked);
else{
print(picked);
}
}
}