middleStringAtIndex method

String? middleStringAtIndex(
  1. int index
)

Implementation

String? middleStringAtIndex(int index) {
  if (index >= 0 && index < 24) {
    DateTime time = currentTime.add(Duration(days: _currentIndex[0]!));
    if (isAtSameDay(minTime, time)) {
      if (index >= 0 && index < 24 - minTime!.hour) {
        return digits(minTime!.hour + index, 2);
      } else {
        return null;
      }
    } else if (isAtSameDay(maxTime, time)) {
      if (index >= 0 && index <= maxTime!.hour) {
        return digits(index, 2);
      } else {
        return null;
      }
    }
    return digits(index, 2);
  }

  return null;
}