No need for SemanticsService.announce() when headless

This commit is contained in:
Dennis Fokin 2024-10-25 13:48:24 +02:00
parent dde475de4b
commit 177c052308
No known key found for this signature in database
GPG Key ID: 870B88256690D8BC

View File

@ -140,8 +140,6 @@ UserInteractionController promptUserInteraction(
void Function()? onCancel, void Function()? onCancel,
bool headless = false, bool headless = false,
}) { }) {
String a11yLabel = title + description;
SemanticsService.announce(a11yLabel, TextDirection.ltr);
if (headless) { if (headless) {
// No support for icon or onCancel. // No support for icon or onCancel.
return _notificationUserInteraction(context, return _notificationUserInteraction(context,
@ -159,6 +157,8 @@ UserInteractionController _dialogUserInteraction(
Widget? icon, Widget? icon,
void Function()? onCancel, void Function()? onCancel,
}) { }) {
String a11yLabel = '$title $description';
SemanticsService.announce(a11yLabel, TextDirection.ltr);
var completed = false; var completed = false;
var wasPopped = false; var wasPopped = false;
final controller = _UserInteractionController( final controller = _UserInteractionController(