dateTimeRangeFormat method Null safety

String dateTimeRangeFormat(
  1. DateTimeRange? period
)

Implementation

static String dateTimeRangeFormat(DateTimeRange? period) {
  String periodFormated = "";

  if (period != null) {
    periodFormated = dateFormat.format(period.start);
  }

  if (period != null && period.end.year != 0) {
    periodFormated += " - ${dateFormat.format(period.end)}";
  }

  return periodFormated;
}