Bruno Leroux c059c9b7da
Fix TextButton.icon breaks focus traversal and ink effect when toggling icon (#176579)
## Description

This PR changes `TextButton.icon` to avoid building a different widget.
When a different widget is created the whole subtree is recreated which
leads to various issues (Focus and A11y issues for instance).
The change is similar to https://github.com/flutter/flutter/pull/175810
which fixed the exact same problem for `OutlinedButton.icon`.

## Related Issue

Fixes [TextButton.icon breaks focus traversal and ink effect when
toggling icon](https://github.com/flutter/flutter/issues/173944)

## Tests

- Adds 1 test

---------

Co-authored-by: chunhtai <47866232+chunhtai@users.noreply.github.com>
2025-10-28 22:07:10 +00:00
..
2025-10-27 17:28:12 +00:00

This directory contains tools and resources that the Flutter team uses during the development of the framework. The tools in this directory should not be necessary for developing Flutter applications, though of course, they may be interesting if you are curious.

The tests in this directory are run in the framework_tests_misc-* shards.