setMiddleIndex method
void
setMiddleIndex(
- int index
)
override
Implementation
@override
void setMiddleIndex(int index) {
super.setMiddleIndex(index);
DateTime time = _dayAt(_currentLeftIndex);
// Re-clamp the minute selection into the window allowed on a boundary day.
if (_isMinDay(time) && index == 0) {
final maxMinuteIndex = 60 - minTime!.minute - 1;
if (_currentRightIndex > maxMinuteIndex) {
_currentRightIndex = maxMinuteIndex;
}
} else if (_isMaxDay(time) && _currentMiddleIndex == maxTime!.hour) {
final maxMinuteIndex = maxTime!.minute;
if (_currentRightIndex > maxMinuteIndex) {
_currentRightIndex = maxMinuteIndex;
}
}
}