Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/ui/notices/notices_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ class NoticesCard extends StatelessWidget {
/// MODELS
final NoticesModel notice;

// VoiceOver/TalkBack read "TWOW" as a made-up word instead of spelling it
// out, so it's spaced into individual letters for the accessibility label only.
static final RegExp _twowPattern = RegExp(r'\bTWOW\b', caseSensitive: false);

static String _spellOutForScreenReaders(String text) => text.replaceAll(_twowPattern, 'T W O W');

@override
Widget build(BuildContext context) {
return Card(
Expand All @@ -32,7 +38,7 @@ class NoticesCard extends StatelessWidget {
Widget buildBannerView(NoticesModel notice) {
// The screen reader will read - "image - (text on the image)"
return Semantics(
label: notice.title,
label: _spellOutForScreenReaders(notice.title),
image: true,
button: true,
child: GestureDetector(
Expand Down
Loading