asLocalDateTimeOr function

DateTime asLocalDateTimeOr(
  1. dynamic json,
  2. String key, {
  3. required DateTime fallback,
})

Returns a local DateTime for the value at key, or fallback if parsing fails.

Implementation

DateTime asLocalDateTimeOr(dynamic json, String key,
    {required DateTime fallback}) {
  final value = _getJsonValueOrNull(json, key);
  return toLocalDateTimeOr(value, fallback: fallback);
}