toDateTimeOr method
Converts to DateTime, falling back to defaultValue on failure.
Implementation
DateTime toDateTimeOr(
DateTime defaultValue, {
dynamic mapKey,
int? listIndex,
String? format,
String? locale,
bool autoDetectFormat = false,
bool useCurrentLocale = false,
bool utc = false,
DynamicConverter<DateTime>? converter,
}) =>
tryToDateTime(
mapKey: mapKey,
listIndex: listIndex,
format: format,
locale: locale,
autoDetectFormat: autoDetectFormat,
useCurrentLocale: useCurrentLocale,
utc: utc,
defaultValue: defaultValue,
converter: converter,
) ??
defaultValue;