unixToDateTime function Null safety

DateTime? unixToDateTime(
  1. int? data
)

Implementation

DateTime? unixToDateTime(int? data) {
  if (data == null) return null;
  final int millis = data * 1000;
  return DateTime.fromMillisecondsSinceEpoch(millis);
}