formatDate method

String? formatDate({
  1. String toFormat = 'dd MM yyyy',
})

Formats the integer (assumed as millisecondsSinceEpoch) using a specified toFormat.

Example:

1700000000000.formatDate(toFormat: "dd MMM yyyy");

Returns null if the integer is null.

Implementation

String? formatDate({String toFormat = 'dd MM yyyy'}) {
  if (this == null) return null;
  return this?.toDate()?.formatDate(targetFormat: toFormat);
}