toFormattedString method

dynamic toFormattedString({
  1. String outputDateFormat = 'yyyy-MM-dd',
  2. String locale = "ID",
})

Implementation

toFormattedString({String outputDateFormat = 'yyyy-MM-dd', String locale = "ID"}) {
  if (this == null) return '-';
  return DateFormat(
    outputDateFormat,
    locale,
  ).format(this ?? DateTime.now());
}