File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -497,7 +497,6 @@ class IconButton extends StatelessWidget {
497497 );
498498 }
499499 return _IconButtonM3 (
500- key: key,
501500 style: adjustedStyle,
502501 onPressed: onPressed,
503502 autofocus: autofocus,
@@ -577,7 +576,6 @@ class IconButton extends StatelessWidget {
577576
578577class _IconButtonM3 extends ButtonStyleButton {
579578 const _IconButtonM3 ({
580- super .key,
581579 required super .onPressed,
582580 super .style,
583581 super .focusNode,
Original file line number Diff line number Diff line change @@ -28,6 +28,22 @@ void main() {
2828 mockOnPressedFunction = MockOnPressedFunction ();
2929 });
3030
31+ testWidgets ('test icon is findable by key' , (WidgetTester tester) async {
32+ const ValueKey <String > key = ValueKey <String >('icon-button' );
33+ await tester.pumpWidget (
34+ wrap (
35+ useMaterial3: true ,
36+ child: IconButton (
37+ key: key,
38+ onPressed: () {},
39+ icon: const Icon (Icons .link),
40+ ),
41+ ),
42+ );
43+
44+ expect (find.byKey (key), findsOneWidget);
45+ });
46+
3147 testWidgets ('test default icon buttons are sized up to 48' , (WidgetTester tester) async {
3248 final bool material3 = theme.useMaterial3;
3349 await tester.pumpWidget (
You can’t perform that action at this time.
0 commit comments