tryGetDateTime method

DateTime? tryGetDateTime(
  1. K key, {
  2. List<K>? alternativeKeys,
  3. dynamic innerKey,
  4. int? innerListIndex,
  5. String? format,
  6. String? locale,
  7. bool autoDetectFormat = false,
  8. bool useCurrentLocale = false,
  9. bool utc = false,
  10. DateTime? defaultValue,
  11. ElementConverter<DateTime>? converter,
})

Tries to convert the value at key (or alternativeKeys) to DateTime.

Implementation

DateTime? tryGetDateTime(
  K key, {
  List<K>? alternativeKeys,
  dynamic innerKey,
  int? innerListIndex,
  String? format,
  String? locale,
  bool autoDetectFormat = false,
  bool useCurrentLocale = false,
  bool utc = false,
  DateTime? defaultValue,
  ElementConverter<DateTime>? converter,
}) => ConvertObjectImpl.tryToDateTime(
  _firstValueForKeys(key, alternativeKeys: alternativeKeys),
  mapKey: innerKey,
  listIndex: innerListIndex,
  format: format,
  locale: locale,
  autoDetectFormat: autoDetectFormat,
  useCurrentLocale: useCurrentLocale,
  utc: utc,
  defaultValue: defaultValue,
  converter: converter,
  debugInfo: {
    'key': key,
    if (alternativeKeys != null && alternativeKeys.isNotEmpty)
      'altKeys': alternativeKeys,
  },
);