I would like to resize text size of initialDate
. I find it's too big on cellphone sized devices.
Future<Null> _selectDate(BuildContext context) async {
var formatter = new DateFormat("yyyy-MM-dd");
final DateTime picked = await showDatePicker(
context: context,
initialDate: selectedDate,
firstDate: DateTime(1901, 1),
lastDate: DateTime(2101),
builder: (context, child) {
return Column(
children: <Widget>[
Container(
height: MediaQuery.of(context).size.height / 1.2,
width: MediaQuery.of(context).size.width / 1.5,
child: child,
),
],
);
});
if (picked != null)
setState(() {
selectedDate = picked;
dateController.value = TextEditingValue(text: formatter.format(picked));
});
}
I borrowed this example code from https://stackoverflow.com/a/60037183/9554434.
child: