mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Remove duplicated key in _IconButtonM3 (#105577)
This commit is contained in:
parent
e09c1325ce
commit
feec13a168
@ -497,7 +497,6 @@ class IconButton extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
return _IconButtonM3(
|
||||
key: key,
|
||||
style: adjustedStyle,
|
||||
onPressed: onPressed,
|
||||
autofocus: autofocus,
|
||||
@ -577,7 +576,6 @@ class IconButton extends StatelessWidget {
|
||||
|
||||
class _IconButtonM3 extends ButtonStyleButton {
|
||||
const _IconButtonM3({
|
||||
super.key,
|
||||
required super.onPressed,
|
||||
super.style,
|
||||
super.focusNode,
|
||||
|
||||
@ -28,6 +28,22 @@ void main() {
|
||||
mockOnPressedFunction = MockOnPressedFunction();
|
||||
});
|
||||
|
||||
testWidgets('test icon is findable by key', (WidgetTester tester) async {
|
||||
const ValueKey<String> key = ValueKey<String>('icon-button');
|
||||
await tester.pumpWidget(
|
||||
wrap(
|
||||
useMaterial3: true,
|
||||
child: IconButton(
|
||||
key: key,
|
||||
onPressed: () {},
|
||||
icon: const Icon(Icons.link),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
expect(find.byKey(key), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('test default icon buttons are sized up to 48', (WidgetTester tester) async {
|
||||
final bool material3 = theme.useMaterial3;
|
||||
await tester.pumpWidget(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user