I try to add a row of cancel and done button above the CupertinoDatePicker inside the Container but however hit error, what could possible go wrong?
════════ Exception caught by rendering library ═════════════════════════════════ A RenderFlex overflowed by Infinity pixels on the bottom. The relevant error-causing widget was Column
String _selectedDueDate;
var formatter = new DateFormat('dd-MM-yyyy');
ListTile(
leading: const Icon(Icons.today),
title: const Text('Due Date*'),
subtitle: _selectedDueDate
onTap: () {
showCupertinoModalPopup(
context: context,
builder: (context) {
return Container(
color: Colors.white,
height: 300.0,
child: Column(
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
FlatButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.zero),
child: Text(
"Cancel",
),
onPressed: () => {},
),
FlatButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.zero),
child: Text(
"Done",
),
onPressed: () => {},
),
],
),
CupertinoDatePicker(
initialDateTime:
DateTime.now().add(new Duration(days: 7)),
minimumDate: DateTime.now(),
mode: CupertinoDatePickerMode.date,
onDateTimeChanged: (date) {
setState(() {
print(date);
_selectedDueDate = formatter.format(date);
});
},
),
],
),
);
});
},
),
