TextButton(
onPressed: () => _showPicker(context),
child: Icon(Icons.calendar_today),
)
Future<DateTime?> _showPicker(BuildContext context) {
return showDatePicker(
context: context, initialDate: DateTime(2000),
firstDate: DateTime(1990),
lastDate: DateTime(2100));
}
The DatePicker pops up, but when you try to select a date or year it throws: Expected a value of type 'String', but got one of type 'Null'
Flutter 2.0.3 • channel stable • https://github.com/flutter/flutter.git Framework • revision 4d7946a68d (7 days ago) • 2021-03-18 17:24:33 -0700 Engine • revision 3459eb2436 Tools • Dart 2.12.2