I need to launch WeekView and immediately jump to a selected event. Something may be initialDate and we can calculate scroll position out from it instead of only scrolling to current time.
@override
void scrollToCurrentTime() {
super.scrollToCurrentTime();
int index = 0;
if (widget.dateCount != null) {
for (; index < widget.dateCount; index++) {
if (Utils.sameDay(widget.dateCreator(index))) {
break;
}
}
}
double topOffset = calculateTopOffset(HourMinute.now());
double leftOffset = dayViewWidth * index;
widget.controller.verticalScrollController.jumpTo(math.min<double>(topOffset, widget.controller.verticalScrollController.position.maxScrollExtent));
widget.controller.horizontalScrollController.jumpTo(math.min<double>(leftOffset, widget.controller.horizontalScrollController.position.maxScrollExtent));
}
I need to launch
WeekView
and immediately jump to a selected event. Something may beinitialDate
and we can calculate scroll position out from it instead of only scrolling to current time.