File tree 2 files changed +16
-2
lines changed 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 {
497
497
);
498
498
}
499
499
return _IconButtonM3 (
500
- key: key,
501
500
style: adjustedStyle,
502
501
onPressed: onPressed,
503
502
autofocus: autofocus,
@@ -577,7 +576,6 @@ class IconButton extends StatelessWidget {
577
576
578
577
class _IconButtonM3 extends ButtonStyleButton {
579
578
const _IconButtonM3 ({
580
- super .key,
581
579
required super .onPressed,
582
580
super .style,
583
581
super .focusNode,
Original file line number Diff line number Diff line change @@ -28,6 +28,22 @@ void main() {
28
28
mockOnPressedFunction = MockOnPressedFunction ();
29
29
});
30
30
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
+
31
47
testWidgets ('test default icon buttons are sized up to 48' , (WidgetTester tester) async {
32
48
final bool material3 = theme.useMaterial3;
33
49
await tester.pumpWidget (
You can’t perform that action at this time.
0 commit comments