dateToFormattedDate static method
Implementation
static String dateToFormattedDate(String? date, bool showYear, {bool? full}) {
if(date == null) return '';
DateTime dateTime = DateTime.parse(date).toLocal();
String formattedDate;
showYear
? formattedDate = DateFormat.yMMMd().format(dateTime)
: formattedDate = DateFormat.MMMd().format(dateTime);
if(full != null){
formattedDate = DateFormat.yMMMMd().format(dateTime);
}
return formattedDate;
}