@@ -419,20 +419,18 @@ void main() {
419419 final GlobalKey childKey = GlobalKey();
420420 bool hovering = false;
421421 await tester.pumpWidget(
422- Material(
423- child: Directionality(
424- textDirection: TextDirection.ltr,
425- child: SizedBox(
426- width: 100,
427- height: 100,
428- child: ElevatedButton(
429- autofocus: true,
430- onPressed: () {},
431- onLongPress: () {},
432- onHover: (bool value) { hovering = value; },
433- focusNode: focusNode,
434- child: SizedBox(key: childKey),
435- ),
422+ Directionality(
423+ textDirection: TextDirection.ltr,
424+ child: SizedBox(
425+ width: 100,
426+ height: 100,
427+ child: ElevatedButton(
428+ autofocus: true,
429+ onPressed: () {},
430+ onLongPress: () {},
431+ onHover: (bool value) { hovering = value; },
432+ focusNode: focusNode,
433+ child: SizedBox(key: childKey),
436434 ),
437435 ),
438436 ),
@@ -447,18 +445,16 @@ void main() {
447445 expect(hovering, isTrue);
448446
449447 await tester.pumpWidget(
450- Material(
451- child: Directionality(
452- textDirection: TextDirection.ltr,
453- child: SizedBox(
454- width: 100,
455- height: 100,
456- child: ElevatedButton(
457- focusNode: focusNode,
458- onHover: (bool value) { hovering = value; },
459- onPressed: null,
460- child: SizedBox(key: childKey),
461- ),
448+ Directionality(
449+ textDirection: TextDirection.ltr,
450+ child: SizedBox(
451+ width: 100,
452+ height: 100,
453+ child: ElevatedButton(
454+ focusNode: focusNode,
455+ onHover: (bool value) { hovering = value; },
456+ onPressed: null,
457+ child: SizedBox(key: childKey),
462458 ),
463459 ),
464460 ),
@@ -473,21 +469,19 @@ void main() {
473469 late bool hover;
474470
475471 Widget buildFrame({ required bool enabled }) {
476- return Material(
477- child: Directionality(
478- textDirection: TextDirection.ltr,
479- child: Center(
480- child: SizedBox(
481- width: 100,
482- height: 100,
483- child: ElevatedButton(
484- onPressed: enabled ? () { } : null,
485- onHover: (bool value) {
486- onHoverCount += 1;
487- hover = value;
488- },
489- child: const Text('ElevatedButton'),
490- ),
472+ return Directionality(
473+ textDirection: TextDirection.ltr,
474+ child: Center(
475+ child: SizedBox(
476+ width: 100,
477+ height: 100,
478+ child: ElevatedButton(
479+ onPressed: enabled ? () { } : null,
480+ onHover: (bool value) {
481+ onHoverCount += 1;
482+ hover = value;
483+ },
484+ child: const Text('ElevatedButton'),
491485 ),
492486 ),
493487 ),
@@ -537,15 +531,13 @@ void main() {
537531 final FocusNode node = FocusNode(debugLabel: 'ElevatedButton Focus');
538532 bool gotFocus = false;
539533 await tester.pumpWidget(
540- Material(
541- child: Directionality(
542- textDirection: TextDirection.ltr,
543- child: ElevatedButton(
544- focusNode: node,
545- onFocusChange: (bool focused) => gotFocus = focused,
546- onPressed: () { },
547- child: const SizedBox(),
548- ),
534+ Directionality(
535+ textDirection: TextDirection.ltr,
536+ child: ElevatedButton(
537+ focusNode: node,
538+ onFocusChange: (bool focused) => gotFocus = focused,
539+ onPressed: () { },
540+ child: const SizedBox(),
549541 ),
550542 ),
551543 );
@@ -568,15 +560,13 @@ void main() {
568560 final FocusNode node = FocusNode(debugLabel: 'ElevatedButton Focus');
569561 bool gotFocus = false;
570562 await tester.pumpWidget(
571- Material(
572- child: Directionality(
573- textDirection: TextDirection.ltr,
574- child: ElevatedButton(
575- focusNode: node,
576- onFocusChange: (bool focused) => gotFocus = focused,
577- onPressed: null,
578- child: const SizedBox(),
579- ),
563+ Directionality(
564+ textDirection: TextDirection.ltr,
565+ child: ElevatedButton(
566+ focusNode: node,
567+ onFocusChange: (bool focused) => gotFocus = focused,
568+ onPressed: null,
569+ child: const SizedBox(),
580570 ),
581571 ),
582572 );
@@ -681,18 +671,16 @@ void main() {
681671 await tester.pumpWidget(
682672 Directionality(
683673 textDirection: TextDirection.ltr,
684- child: Material(
685- child: Center(
686- child: ElevatedButton(
687- style: ButtonStyle(
688- // Specifying minimumSize to mimic the original minimumSize for
689- // RaisedButton so that the semantics tree's rect and transform
690- // match the original version of this test.
691- minimumSize: MaterialStateProperty.all<Size>(const Size(88, 36)),
692- ),
693- onPressed: () { },
694- child: const Text('ABC'),
674+ child: Center(
675+ child: ElevatedButton(
676+ style: ButtonStyle(
677+ // Specifying minimumSize to mimic the original minimumSize for
678+ // RaisedButton so that the semantics tree's rect and transform
679+ // match the original version of this test.
680+ minimumSize: MaterialStateProperty.all<Size>(const Size(88, 36)),
695681 ),
682+ onPressed: () { },
683+ child: const Text('ABC'),
696684 ),
697685 ),
698686 ),
@@ -736,14 +724,12 @@ void main() {
736724 data: ThemeData(materialTapTargetSize: tapTargetSize),
737725 child: Directionality(
738726 textDirection: TextDirection.ltr,
739- child: Material(
740- child: Center(
741- child: ElevatedButton(
742- key: key,
743- style: style,
744- child: const SizedBox(width: 50.0, height: 8.0),
745- onPressed: () { },
746- ),
727+ child: Center(
728+ child: ElevatedButton(
729+ key: key,
730+ style: style,
731+ child: const SizedBox(width: 50.0, height: 8.0),
732+ onPressed: () { },
747733 ),
748734 ),
749735 ),
@@ -763,11 +749,9 @@ void main() {
763749 await tester.pumpWidget(
764750 Directionality(
765751 textDirection: TextDirection.ltr,
766- child: Material(
767- child: ElevatedButton(
768- onPressed: () { /* to make sure the button is enabled */ },
769- child: const Text('button'),
770- ),
752+ child: ElevatedButton(
753+ onPressed: () { /* to make sure the button is enabled */ },
754+ child: const Text('button'),
771755 ),
772756 ),
773757 );
@@ -855,19 +839,17 @@ void main() {
855839 // horizontal padding is applied correctly later on
856840 Directionality(
857841 textDirection: TextDirection.ltr,
858- child: Material(
859- child: Center(
860- child: ElevatedButton.icon(
861- key: buttonKey,
862- style: ButtonStyle(
863- padding: MaterialStateProperty.all<EdgeInsets>(const EdgeInsets.fromLTRB(16, 5, 10, 12)),
864- ),
865- onPressed: () {},
866- icon: const Icon(Icons.add),
867- label: const Text(
868- 'Hello',
869- key: labelKey,
870- ),
842+ child: Center(
843+ child: ElevatedButton.icon(
844+ key: buttonKey,
845+ style: ButtonStyle(
846+ padding: MaterialStateProperty.all<EdgeInsets>(const EdgeInsets.fromLTRB(16, 5, 10, 12)),
847+ ),
848+ onPressed: () {},
849+ icon: const Icon(Icons.add),
850+ label: const Text(
851+ 'Hello',
852+ key: labelKey,
871853 ),
872854 ),
873855 ),
0 commit comments