[GAR] [a11y] Update text button page in a11y assessment app (#148905)
internal: b/317125569 If the text button label contains its role and state, it will be confusing for tester. it will be announced like "xxx button button" : <img src="https://github.com/flutter/flutter/assets/108393416/16f5a996-b0f1-4f04-bd99-caa3cacd4182" width=50% height=50%> updated screen and label: <img src="https://github.com/flutter/flutter/assets/108393416/1de55cec-8a18-4c36-9dac-84ae7d151fd6" width=50% height=50%>
This commit is contained in:
parent
54573bc875
commit
1aba3a66f5
@ -39,13 +39,25 @@ class MainWidgetState extends State<MainWidget> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
TextButton(
|
Row(
|
||||||
onPressed: () { },
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
child: const Text('Text button'),
|
children: <Widget>[
|
||||||
|
const Text('This is a TextButton:'),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () { },
|
||||||
|
child: const Text('Action'),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
const TextButton(
|
const Row(
|
||||||
onPressed: null,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
child: Text('Text button disabled'),
|
children: <Widget>[
|
||||||
|
Text('This is a disabled TextButton:'),
|
||||||
|
TextButton(
|
||||||
|
onPressed: null,
|
||||||
|
child: Text('Action'),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -10,7 +10,6 @@ import 'test_utils.dart';
|
|||||||
void main() {
|
void main() {
|
||||||
testWidgets('text button can run', (WidgetTester tester) async {
|
testWidgets('text button can run', (WidgetTester tester) async {
|
||||||
await pumpsUseCase(tester, TextButtonUseCase());
|
await pumpsUseCase(tester, TextButtonUseCase());
|
||||||
expect(find.text('Text button'), findsOneWidget);
|
expect(find.text('Action'), findsExactly(2));
|
||||||
expect(find.text('Text button disabled'), findsOneWidget);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user