announce method Null safety

Future<void> announce(
  1. String message,
  2. TextDirection textDirection

Sends a semantic announcement.

This should be used for announcement that are not seamlessly announced by the system as a result of a UI state change.

For example a camera application can use this method to make accessibility announcements regarding objects in the viewfinder.


static Future<void> announce(String message, TextDirection textDirection) async {
  final AnnounceSemanticsEvent event = AnnounceSemanticsEvent(message, textDirection);
  await SystemChannels.accessibility.send(event.toMap());