calculateDistanceFromStart method

double calculateDistanceFromStart(
  1. CalendarEvent event
)

Calculates the distance from the start of the day to the start of the event.

event - The event to calculate the distance from.

Implementation

double calculateDistanceFromStart(CalendarEvent event) {
  final eventStart = event.internalRange(location: location).dateTimeRangeOnDate(date)?.start ?? date.startOfDay;
  final dateStart = timeOfDayRange.start.toInternalDateTime(date);
  final difference = eventStart.difference(dateStart);
  final height = difference.inSeconds * heightPerMinute / 60;
  return height;
}