encodeSearchDate method Null safety

String encodeSearchDate(
  1. DateTime dateTime
)

Encodes only day-month-year of the given dateTime, e.g. "1-MAR-2021"

Implementation

static String encodeSearchDate(DateTime dateTime) {
  final buffer = StringBuffer();
  buffer
    ..write('"')
    ..write(dateTime.day)
    ..write('-')
    ..write(_months[dateTime.month - 1])
    ..write('-')
    ..write(dateTime.year)
    ..write('"');
  return buffer.toString();
}