From 177c0523087abf06b0627314b7924ab8a0f907e7 Mon Sep 17 00:00:00 2001 From: Dennis Fokin Date: Fri, 25 Oct 2024 13:48:24 +0200 Subject: [PATCH] No need for SemanticsService.announce() when headless --- lib/app/views/user_interaction.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/app/views/user_interaction.dart b/lib/app/views/user_interaction.dart index 74f05ba6..f95f4180 100755 --- a/lib/app/views/user_interaction.dart +++ b/lib/app/views/user_interaction.dart @@ -140,8 +140,6 @@ UserInteractionController promptUserInteraction( void Function()? onCancel, bool headless = false, }) { - String a11yLabel = title + description; - SemanticsService.announce(a11yLabel, TextDirection.ltr); if (headless) { // No support for icon or onCancel. return _notificationUserInteraction(context, @@ -159,6 +157,8 @@ UserInteractionController _dialogUserInteraction( Widget? icon, void Function()? onCancel, }) { + String a11yLabel = '$title $description'; + SemanticsService.announce(a11yLabel, TextDirection.ltr); var completed = false; var wasPopped = false; final controller = _UserInteractionController(