I want to display date in format 17 May 2022 but when using DateFormat it is throwing the below Exception.
Trying to read MMMM from 2022-05-16 21:39:39.333741 at position 0
return GroupedListView<dynamic, DateTime>(
elements: messageList,
groupBy: (element) => DateFormat.yMMMMd().parse(element['time']),
groupSeparatorBuilder: (DateTime groupByvalue) {
return Container(child: Text(DateFormat.yMMMMd().format(groupByvalue)));
},
itemBuilder: (context, element) {
return Container(
child: Text(element['message']),
);
},
);
{ 'time': '2022-05-16 21:39:39.333741', 'message': "hello", 'messagetype': Messagetype.receiver },
above is a sample 'time' i used.
