isBetween function

bool isBetween(
  1. String str,
  2. String from,
  3. String to
)

Returns true if str represents a date strictly between from and to.

Implementation

bool isBetween(String str, String from, String to) {
  final date = tryParseDate(str);
  final f = tryParseDate(from);
  final t = tryParseDate(to);
  if (date == null || f == null || t == null) return false;
  return date.isAfter(f) && date.isBefore(t);
}