isCross method

bool isCross(
  1. TimeRange other
)

Implementation

bool isCross(TimeRange other) {
  final first = start.inMins <= other.start.inMins ? this : other;
  final last = first == this ? other : this;

  final aGreaterOrEqualC = first.start.inMins <= last.start.inMins;
  final cInsideFirst = last.start.inMins < first.end.inMins;

  return aGreaterOrEqualC && cInsideFirst;
}