date method Null safety
Return a new date format using the specified pattern
.
If desiredLocale
is not specified, then we default to locale.
Implementation
DateFormat date([String? pattern, String? desiredLocale]) {
var actualLocale = (desiredLocale == null) ? locale : desiredLocale;
return DateFormat(pattern, actualLocale);
}