Skip to content

_IconButtonM3 reusing key #105554

@cedvdb

Description

@cedvdb

the new _IconButtonM3 is reusing the parent widget key. (line 500 of icon_button.dart)

      return _IconButtonM3(
        key: key,
        // ...
      );

which can make some tests fail, "expected 1 widget with key x but found 2" .

As explained in a similar issue where flutter duplicates keys, here: #103266 , I'm under the impression that flutter should not reuse keys. I could be wrong though as this seems to be something recurring. It's definitely unexpected though.

This was caught by our test suite updating to latest master.

Metadata

Metadata

Assignees

Labels

a: tests"flutter test", flutter_test, or one of our testsf: material designflutter/packages/flutter/material repository.found in release: 3.1Found to occur in 3.1frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions