difference static method

Duration difference(
  1. dynamic time
)

Implementation

static Duration difference(time) {
  if (time == null) {
    return const Duration();
  }
  var dateTime = DateUtil.getDateTimeByMs(time);
  DateTime today = DateTime.now();
  Duration difference = dateTime.difference(today);

  return difference;
}