semanticsLabel property

String get semanticsLabel

A screen-reader description of this event — its title, day-column label, time span and duration — so the otherwise-opaque CustomPaint canvas exposes each event to assistive technology (#21). English-only for now, matching the (also unlocalized) context-menu strings.

Implementation

String get semanticsLabel {
  final time = entry.time;
  final labels = manager.config.labels;
  final dayLabel =
      (time.day >= 0 && time.day < labels.length) ? labels[time.day] : null;
  final start = _formatClock(time.hour, time.minutes);
  final endTotal = time.hour * 60 + time.minutes + time.duration;
  final end = _formatClock(endTotal ~/ 60, endTotal % 60);

  return [
    entry.title,
    if (dayLabel != null && dayLabel.isNotEmpty) dayLabel,
    '$start to $end',
    _formatDuration(time.duration),
  ].join(', ');
}