Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix text button example in a11y assessment app #148247

Closed
wants to merge 1 commit into from

Conversation

chunhtai
Copy link
Contributor

b/317125569

text button should not have "button" in the text, it will confuse user as it button will be announced twice

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@chunhtai chunhtai requested a review from yjbanov May 13, 2024 19:11
@github-actions github-actions bot added the a: text input Entering text in a text field or keyboard related problems label May 13, 2024
testWidgets('text button must not contain "button" in their text', (WidgetTester tester) async {
await pumpsUseCase(tester, TextButtonUseCase());
final List<Text> texts = tester.widgetList<Text>(
find.descendant(of: find.byType(TextButton), matching: find.byType(Text)),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could get rid of the loop by using find.textContaining

@chunhtai
Copy link
Contributor Author

closing this since this pr is closer #148905

@chunhtai chunhtai closed this May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: text input Entering text in a text field or keyboard related problems
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants