rightStringAtIndex method

String? rightStringAtIndex(
  1. int index
)

Implementation

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

  return null;
}