setLeftIndex method Null safety

  1. @override
void setLeftIndex(
  1. int index
)
override

Implementation

@override
void setLeftIndex(int index) {
  super.setLeftIndex(index);
  DateTime time = currentTime.add(Duration(days: index));
  if (isAtSameDay(minTime, time)) {
    var index = min(24 - minTime!.hour - 1, _currentMiddleIndex);
    this.setMiddleIndex(index);
  } else if (isAtSameDay(maxTime, time)) {
    var index = min(maxTime!.hour, _currentMiddleIndex);
    this.setMiddleIndex(index);
  }
}