Hello! I'm using your widget CategoryCalendarDayView. I found 1 issue, that makes my life harder. In getTimeList method you do not take into account the information about timeEnd/start minutes, and carry out all calculations only with hours. It doesn't make sense. If im trying to make timeEnd = 13:15 => last row to draw will be 13:00 - timeGap (if gap = 15, last row to draw will be 12:45, if gap = 1, last row to draw will be 12:59 and etc.). I hope these note will help you to solve this problem. Thank you for your reply.
List getTimeList({
required TimeOfDay startOfDay,
TimeOfDay? endOfDay,
required int timeGap,
}) {
final timeEnd = endOfDay ?? const TimeOfDay(hour: 23, minute: 0);
final timeCount = !!!(PROBLEM IS HERE)!!!=> ((timeEnd.hour - startOfDay.hour) * 60) ~/ timeGap;
DateTime first = DateTime.parse(
"2012-02-27T${startOfDay.hour.toString().padLeft(2, '0')}:00");
List list = [];
for (var i = 1; i <= timeCount; i++) {
list.add(TimeOfDay.fromDateTime(first));
first = first.add(Duration(minutes: timeGap));
}
return list;
}
Hello! I'm using your widget CategoryCalendarDayView. I found 1 issue, that makes my life harder. In getTimeList method you do not take into account the information about timeEnd/start minutes, and carry out all calculations only with hours. It doesn't make sense. If im trying to make timeEnd = 13:15 => last row to draw will be 13:00 - timeGap (if gap = 15, last row to draw will be 12:45, if gap = 1, last row to draw will be 12:59 and etc.). I hope these note will help you to solve this problem. Thank you for your reply.
List getTimeList({
required TimeOfDay startOfDay,
TimeOfDay? endOfDay,
required int timeGap,
}) {
final timeEnd = endOfDay ?? const TimeOfDay(hour: 23, minute: 0);
final timeCount = !!!(PROBLEM IS HERE)!!!=> ((timeEnd.hour - startOfDay.hour) * 60) ~/ timeGap; DateTime first = DateTime.parse( "2012-02-27T${startOfDay.hour.toString().padLeft(2, '0')}:00"); List list = [];
for (var i = 1; i <= timeCount; i++) {
list.add(TimeOfDay.fromDateTime(first));
first = first.add(Duration(minutes: timeGap));
}
return list;
}