implemented comprehensive accessibility (A11y) support across the app

This commit is contained in:
2026-07-13 23:41:47 +02:00
parent 8274dd46cd
commit 478f0ff20b
46 changed files with 590 additions and 226 deletions
+49
View File
@@ -0,0 +1,49 @@
import '../../extensions/date_time.dart';
/// Zentrale deutschsprachige Screenreader-Labels. Single Source of Truth für
/// alle `Semantics`/`semanticLabel`/`tooltip`-Texte und der eine Punkt, an
/// dem später echtes l10n andockt (die App ist aktuell fest auf `de`).
abstract final class A11yLabels {
// Zustände
static const loading = 'Lädt';
static const downloadingFile = 'Lädt herunter';
// Chat
static const messageRead = 'Gelesen';
static const messageSent = 'Gesendet';
static const unread = 'Ungelesen';
static const favorite = 'Favorit';
static const draft = 'Entwurf';
static const yourReaction = 'deine Reaktion';
// Bilder
static const profilePicture = 'Profilbild';
static const groupPicture = 'Gruppenbild';
static const roomPlan = 'Raumplan der Schule als Grafik';
// Stundenplan
static const cancelled = 'Ausfall';
static const breakTime = 'Pause';
static const allDay = 'Ganztägig';
/// Beschreibt eine Stundenplan-Kachel für den Screenreader, z.B.
/// „Mathe, Raum 101, 08:0008:45, Ausfall". Zeilenumbrüche in [location]
/// (Raum/Lehrer stehen dort mehrzeilig) werden zu Trennern geglättet.
static String appointmentLabel({
required String subject,
required String location,
required DateTime start,
required DateTime end,
required bool crossedOut,
}) {
final parts = <String>[subject];
final loc = location.replaceAll('\n', ', ').trim();
if (loc.isNotEmpty) parts.add(loc);
parts.add('${start.formatHm()}${end.formatHm()}');
if (crossedOut) parts.add(cancelled);
return parts.join(', ');
}
/// „+3 weitere Termine" für die zusammengefasste Overflow-Kachel.
static String moreAppointments(int count) => '+$count weitere Termine';
}