Skip to content

Instantly share code, notes, and snippets.

@abhaysood
Last active October 4, 2021 02:34
Show Gist options
  • Save abhaysood/3afdd706bd16cb66eebd33fa3a90aab7 to your computer and use it in GitHub Desktop.
Save abhaysood/3afdd706bd16cb66eebd33fa3a90aab7 to your computer and use it in GitHub Desktop.
Testing a semantic announcement in Flutter
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: ElevatedButton(
child: Text("announce"),
onPressed: () => SemanticsService.announce("announcement made", TextDirection.ltr),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment