getFormattedDateString static method
Convert date
to String according to pattern
.
Implementation
static String getFormattedDateString(
DateTime date, {
String pattern = 'dd-MM-yyyy',
}) {
final formatter = DateFormat(pattern);
return formatter.format(date);
}