I am trying to display a DateTime
as text in a ListTile
.
What I have done gives me the message:
The argument type 'String' can't be assigned to the parameter type 'DateTime'
Code:
_getDate() {
String formattedDate = DateFormat(yyyy-MM-dd).format(widget.exampleForDate.myDate);
return ListTile(
title: Text(formattedDate),
);
}