isBetween method

bool? isBetween(
  1. DateTime fromDateTime,
  2. DateTime toDateTime
)

Implementation

bool? isBetween(
  DateTime fromDateTime,
  DateTime toDateTime,
) {
  final date = this;
  if (date != null) {
    final isAfter = date.isAfterOrEqualTo(fromDateTime) ?? false;
    final isBefore = date.isBeforeOrEqualTo(toDateTime) ?? false;
    return isAfter && isBefore;
  }
  return null;
}