segmentDuration method
Calculates the segments duration based on the timeOfDayRange, heightPerMinute, and itemHeight.
Implementation
int segmentDuration(KalenderTimeRange timeOfDayRange, double heightPerMinute, double itemHeight) {
final totalHeight = timeOfDayRange.duration.inMinutes * heightPerMinute;
final totalItems = (totalHeight / itemHeight).ceil();
return switch (totalItems) {
< 12 => 60,
< 24 => 30,
< 48 => 15,
_ => 5,
};
}