dateTimeOf function

DateTime? dateTimeOf(
  1. dynamic json
)

Implementation

DateTime? dateTimeOf(json) {
  if (json == null) return null;
  if (json is num) {
    DateTime.fromMillisecondsSinceEpoch(json.toInt(), isUtc: true);
  } else {
    return DateTime.parse(json.toString());
  }
}