Unverified Commit 26d4e927 authored by Viren Khatri's avatar Viren Khatri Committed by GitHub

removes Material (#96899)

parent a6504ead
...@@ -419,8 +419,7 @@ void main() { ...@@ -419,8 +419,7 @@ void main() {
final GlobalKey childKey = GlobalKey(); final GlobalKey childKey = GlobalKey();
bool hovering = false; bool hovering = false;
await tester.pumpWidget( await tester.pumpWidget(
Material( Directionality(
child: Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: SizedBox( child: SizedBox(
width: 100, width: 100,
...@@ -435,7 +434,6 @@ void main() { ...@@ -435,7 +434,6 @@ void main() {
), ),
), ),
), ),
),
); );
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(focusNode.hasPrimaryFocus, isTrue); expect(focusNode.hasPrimaryFocus, isTrue);
...@@ -447,8 +445,7 @@ void main() { ...@@ -447,8 +445,7 @@ void main() {
expect(hovering, isTrue); expect(hovering, isTrue);
await tester.pumpWidget( await tester.pumpWidget(
Material( Directionality(
child: Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: SizedBox( child: SizedBox(
width: 100, width: 100,
...@@ -461,7 +458,6 @@ void main() { ...@@ -461,7 +458,6 @@ void main() {
), ),
), ),
), ),
),
); );
await tester.pumpAndSettle(); await tester.pumpAndSettle();
...@@ -473,8 +469,7 @@ void main() { ...@@ -473,8 +469,7 @@ void main() {
late bool hover; late bool hover;
Widget buildFrame({ required bool enabled }) { Widget buildFrame({ required bool enabled }) {
return Material( return Directionality(
child: Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Center( child: Center(
child: SizedBox( child: SizedBox(
...@@ -490,7 +485,6 @@ void main() { ...@@ -490,7 +485,6 @@ void main() {
), ),
), ),
), ),
),
); );
} }
...@@ -537,8 +531,7 @@ void main() { ...@@ -537,8 +531,7 @@ void main() {
final FocusNode node = FocusNode(debugLabel: 'ElevatedButton Focus'); final FocusNode node = FocusNode(debugLabel: 'ElevatedButton Focus');
bool gotFocus = false; bool gotFocus = false;
await tester.pumpWidget( await tester.pumpWidget(
Material( Directionality(
child: Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: ElevatedButton( child: ElevatedButton(
focusNode: node, focusNode: node,
...@@ -547,7 +540,6 @@ void main() { ...@@ -547,7 +540,6 @@ void main() {
child: const SizedBox(), child: const SizedBox(),
), ),
), ),
),
); );
node.requestFocus(); node.requestFocus();
...@@ -568,8 +560,7 @@ void main() { ...@@ -568,8 +560,7 @@ void main() {
final FocusNode node = FocusNode(debugLabel: 'ElevatedButton Focus'); final FocusNode node = FocusNode(debugLabel: 'ElevatedButton Focus');
bool gotFocus = false; bool gotFocus = false;
await tester.pumpWidget( await tester.pumpWidget(
Material( Directionality(
child: Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: ElevatedButton( child: ElevatedButton(
focusNode: node, focusNode: node,
...@@ -578,7 +569,6 @@ void main() { ...@@ -578,7 +569,6 @@ void main() {
child: const SizedBox(), child: const SizedBox(),
), ),
), ),
),
); );
node.requestFocus(); node.requestFocus();
...@@ -681,7 +671,6 @@ void main() { ...@@ -681,7 +671,6 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: Center( child: Center(
child: ElevatedButton( child: ElevatedButton(
style: ButtonStyle( style: ButtonStyle(
...@@ -695,7 +684,6 @@ void main() { ...@@ -695,7 +684,6 @@ void main() {
), ),
), ),
), ),
),
); );
expect(semantics, hasSemantics( expect(semantics, hasSemantics(
...@@ -736,7 +724,6 @@ void main() { ...@@ -736,7 +724,6 @@ void main() {
data: ThemeData(materialTapTargetSize: tapTargetSize), data: ThemeData(materialTapTargetSize: tapTargetSize),
child: Directionality( child: Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: Center( child: Center(
child: ElevatedButton( child: ElevatedButton(
key: key, key: key,
...@@ -746,7 +733,6 @@ void main() { ...@@ -746,7 +733,6 @@ void main() {
), ),
), ),
), ),
),
); );
} }
...@@ -763,13 +749,11 @@ void main() { ...@@ -763,13 +749,11 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: ElevatedButton( child: ElevatedButton(
onPressed: () { /* to make sure the button is enabled */ }, onPressed: () { /* to make sure the button is enabled */ },
child: const Text('button'), child: const Text('button'),
), ),
), ),
),
); );
expect( expect(
...@@ -855,7 +839,6 @@ void main() { ...@@ -855,7 +839,6 @@ void main() {
// horizontal padding is applied correctly later on // horizontal padding is applied correctly later on
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: Center( child: Center(
child: ElevatedButton.icon( child: ElevatedButton.icon(
key: buttonKey, key: buttonKey,
...@@ -871,7 +854,6 @@ void main() { ...@@ -871,7 +854,6 @@ void main() {
), ),
), ),
), ),
),
); );
final Rect paddingRect = tester.getRect(find.byType(Padding)); final Rect paddingRect = tester.getRect(find.byType(Padding));
......
...@@ -395,13 +395,11 @@ void main() { ...@@ -395,13 +395,11 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: FlatButton( child: FlatButton(
child: Container(), child: Container(),
onPressed: () { /* to make sure the button is enabled */ }, onPressed: () { /* to make sure the button is enabled */ },
), ),
), ),
),
); );
expect( expect(
...@@ -536,7 +534,6 @@ void main() { ...@@ -536,7 +534,6 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: Center( child: Center(
child: FlatButton( child: FlatButton(
onPressed: () { }, onPressed: () { },
...@@ -544,7 +541,6 @@ void main() { ...@@ -544,7 +541,6 @@ void main() {
), ),
), ),
), ),
),
); );
expect(semantics, hasSemantics( expect(semantics, hasSemantics(
...@@ -576,7 +572,6 @@ void main() { ...@@ -576,7 +572,6 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: MediaQuery( child: MediaQuery(
data: const MediaQueryData(), data: const MediaQueryData(),
child: Center( child: Center(
...@@ -587,7 +582,6 @@ void main() { ...@@ -587,7 +582,6 @@ void main() {
), ),
), ),
), ),
),
); );
expect(tester.getSize(find.byType(FlatButton)), equals(const Size(88.0, 48.0))); expect(tester.getSize(find.byType(FlatButton)), equals(const Size(88.0, 48.0)));
...@@ -597,7 +591,6 @@ void main() { ...@@ -597,7 +591,6 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: MediaQuery( child: MediaQuery(
data: const MediaQueryData(textScaleFactor: 1.3), data: const MediaQueryData(textScaleFactor: 1.3),
child: Center( child: Center(
...@@ -608,7 +601,6 @@ void main() { ...@@ -608,7 +601,6 @@ void main() {
), ),
), ),
), ),
),
); );
expect(tester.getSize(find.byType(FlatButton)), equals(const Size(88.0, 48.0))); expect(tester.getSize(find.byType(FlatButton)), equals(const Size(88.0, 48.0)));
...@@ -621,7 +613,6 @@ void main() { ...@@ -621,7 +613,6 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: MediaQuery( child: MediaQuery(
data: const MediaQueryData(textScaleFactor: 3.0), data: const MediaQueryData(textScaleFactor: 3.0),
child: Center( child: Center(
...@@ -632,7 +623,6 @@ void main() { ...@@ -632,7 +623,6 @@ void main() {
), ),
), ),
), ),
),
); );
// Scaled text rendering is different on Linux and Mac by one pixel. // Scaled text rendering is different on Linux and Mac by one pixel.
...@@ -650,7 +640,6 @@ void main() { ...@@ -650,7 +640,6 @@ void main() {
data: ThemeData(materialTapTargetSize: MaterialTapTargetSize.padded), data: ThemeData(materialTapTargetSize: MaterialTapTargetSize.padded),
child: Directionality( child: Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: Center( child: Center(
child: FlatButton( child: FlatButton(
key: key1, key: key1,
...@@ -660,7 +649,6 @@ void main() { ...@@ -660,7 +649,6 @@ void main() {
), ),
), ),
), ),
),
); );
expect(tester.getSize(find.byKey(key1)), const Size(88.0, 48.0)); expect(tester.getSize(find.byKey(key1)), const Size(88.0, 48.0));
...@@ -671,7 +659,6 @@ void main() { ...@@ -671,7 +659,6 @@ void main() {
data: ThemeData(materialTapTargetSize: MaterialTapTargetSize.shrinkWrap), data: ThemeData(materialTapTargetSize: MaterialTapTargetSize.shrinkWrap),
child: Directionality( child: Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: Center( child: Center(
child: FlatButton( child: FlatButton(
key: key2, key: key2,
...@@ -681,7 +668,6 @@ void main() { ...@@ -681,7 +668,6 @@ void main() {
), ),
), ),
), ),
),
); );
expect(tester.getSize(find.byKey(key2)), const Size(88.0, 36.0)); expect(tester.getSize(find.byKey(key2)), const Size(88.0, 36.0));
......
...@@ -897,13 +897,11 @@ void main() { ...@@ -897,13 +897,11 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: FloatingActionButton( child: FloatingActionButton(
focusNode: focusNode, focusNode: focusNode,
onPressed: () { /* to make sure the button is enabled */ }, onPressed: () { /* to make sure the button is enabled */ },
), ),
), ),
),
); );
focusNode.unfocus(); focusNode.unfocus();
......
...@@ -431,15 +431,13 @@ void main() { ...@@ -431,15 +431,13 @@ void main() {
const Color directSplashColor = Color(0xFF000011); const Color directSplashColor = Color(0xFF000011);
const Color directHighlightColor = Color(0xFF000011); const Color directHighlightColor = Color(0xFF000011);
Widget buttonWidget = Material( Widget buttonWidget = Center(
child: Center(
child: MaterialButton( child: MaterialButton(
splashColor: directSplashColor, splashColor: directSplashColor,
highlightColor: directHighlightColor, highlightColor: directHighlightColor,
onPressed: () { /* to make sure the button is enabled */ }, onPressed: () { /* to make sure the button is enabled */ },
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
), ),
),
); );
await tester.pumpWidget( await tester.pumpWidget(
...@@ -459,14 +457,16 @@ void main() { ...@@ -459,14 +457,16 @@ void main() {
await tester.pump(); // start gesture await tester.pump(); // start gesture
await tester.pump(const Duration(milliseconds: 200)); // wait for splash to be well under way await tester.pump(const Duration(milliseconds: 200)); // wait for splash to be well under way
const Rect expectedClipRect = Rect.fromLTRB(356.0, 282.0, 444.0, 318.0); // Painter is translated to the center by the Center widget and not
// the Material widget.
const Rect expectedClipRect = Rect.fromLTRB(0.0, 0.0, 88.0, 36.0);
final Path expectedClipPath = Path() final Path expectedClipPath = Path()
..addRRect(RRect.fromRectAndRadius( ..addRRect(RRect.fromRectAndRadius(
expectedClipRect, expectedClipRect,
const Radius.circular(2.0), const Radius.circular(2.0),
)); ));
expect( expect(
Material.of(tester.element(find.byType(MaterialButton))), Material.of(tester.element(find.byType(InkWell))),
paints paints
..clipPath(pathMatcher: coversSameAreaAs( ..clipPath(pathMatcher: coversSameAreaAs(
expectedClipPath, expectedClipPath,
...@@ -479,13 +479,11 @@ void main() { ...@@ -479,13 +479,11 @@ void main() {
const Color themeSplashColor1 = Color(0xFF001100); const Color themeSplashColor1 = Color(0xFF001100);
const Color themeHighlightColor1 = Color(0xFF001100); const Color themeHighlightColor1 = Color(0xFF001100);
buttonWidget = Material( buttonWidget = Center(
child: Center(
child: MaterialButton( child: MaterialButton(
onPressed: () { /* to make sure the button is enabled */ }, onPressed: () { /* to make sure the button is enabled */ },
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
), ),
),
); );
await tester.pumpWidget( await tester.pumpWidget(
...@@ -503,7 +501,7 @@ void main() { ...@@ -503,7 +501,7 @@ void main() {
); );
expect( expect(
Material.of(tester.element(find.byType(MaterialButton))), Material.of(tester.element(find.byType(InkWell))),
paints paints
..clipPath(pathMatcher: coversSameAreaAs( ..clipPath(pathMatcher: coversSameAreaAs(
expectedClipPath, expectedClipPath,
...@@ -531,7 +529,7 @@ void main() { ...@@ -531,7 +529,7 @@ void main() {
); );
expect( expect(
Material.of(tester.element(find.byType(MaterialButton))), Material.of(tester.element(find.byType(InkWell))),
paints paints
..circle(color: themeSplashColor2) ..circle(color: themeSplashColor2)
..rect(color: themeHighlightColor2), ..rect(color: themeHighlightColor2),
...@@ -542,13 +540,11 @@ void main() { ...@@ -542,13 +540,11 @@ void main() {
testWidgets('MaterialButton has no clip by default', (WidgetTester tester) async { testWidgets('MaterialButton has no clip by default', (WidgetTester tester) async {
final GlobalKey buttonKey = GlobalKey(); final GlobalKey buttonKey = GlobalKey();
final Widget buttonWidget = Material( final Widget buttonWidget = Center(
child: Center(
child: MaterialButton( child: MaterialButton(
key: buttonKey, key: buttonKey,
onPressed: () { /* to make sure the button is enabled */ }, onPressed: () { /* to make sure the button is enabled */ },
), ),
),
); );
await tester.pumpWidget( await tester.pumpWidget(
...@@ -583,14 +579,12 @@ void main() { ...@@ -583,14 +579,12 @@ void main() {
// enabled button // enabled button
await tester.pumpWidget(Directionality( await tester.pumpWidget(Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: Center( child: Center(
child: MaterialButton( child: MaterialButton(
child: const Text('Button'), child: const Text('Button'),
onPressed: () { /* to make sure the button is enabled */ }, onPressed: () { /* to make sure the button is enabled */ },
), ),
), ),
),
)); ));
expect(semantics, hasSemantics( expect(semantics, hasSemantics(
...@@ -618,14 +612,12 @@ void main() { ...@@ -618,14 +612,12 @@ void main() {
// disabled button // disabled button
await tester.pumpWidget(const Directionality( await tester.pumpWidget(const Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: Center( child: Center(
child: MaterialButton( child: MaterialButton(
onPressed: null, // button is disabled onPressed: null, // button is disabled
child: Text('Button'), child: Text('Button'),
), ),
), ),
),
)); ));
expect(semantics, hasSemantics( expect(semantics, hasSemantics(
...@@ -724,7 +716,6 @@ void main() { ...@@ -724,7 +716,6 @@ void main() {
data: ThemeData(materialTapTargetSize: MaterialTapTargetSize.padded), data: ThemeData(materialTapTargetSize: MaterialTapTargetSize.padded),
child: Directionality( child: Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: Center( child: Center(
child: MaterialButton( child: MaterialButton(
key: key1, key: key1,
...@@ -734,7 +725,6 @@ void main() { ...@@ -734,7 +725,6 @@ void main() {
), ),
), ),
), ),
),
); );
expect(tester.getSize(find.byKey(key1)), const Size(88.0, 48.0)); expect(tester.getSize(find.byKey(key1)), const Size(88.0, 48.0));
...@@ -745,7 +735,6 @@ void main() { ...@@ -745,7 +735,6 @@ void main() {
data: ThemeData(materialTapTargetSize: MaterialTapTargetSize.shrinkWrap), data: ThemeData(materialTapTargetSize: MaterialTapTargetSize.shrinkWrap),
child: Directionality( child: Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: Center( child: Center(
child: MaterialButton( child: MaterialButton(
key: key2, key: key2,
...@@ -755,7 +744,6 @@ void main() { ...@@ -755,7 +744,6 @@ void main() {
), ),
), ),
), ),
),
); );
expect(tester.getSize(find.byKey(key2)), const Size(88.0, 36.0)); expect(tester.getSize(find.byKey(key2)), const Size(88.0, 36.0));
......
...@@ -845,7 +845,6 @@ void main() { ...@@ -845,7 +845,6 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: Center( child: Center(
child: OutlineButton( child: OutlineButton(
key: buttonKey, key: buttonKey,
...@@ -854,7 +853,6 @@ void main() { ...@@ -854,7 +853,6 @@ void main() {
), ),
), ),
), ),
),
); );
expect( expect(
...@@ -868,7 +866,6 @@ void main() { ...@@ -868,7 +866,6 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: Center( child: Center(
child: OutlineButton( child: OutlineButton(
onPressed: () {}, onPressed: () {},
...@@ -876,7 +873,6 @@ void main() { ...@@ -876,7 +873,6 @@ void main() {
), ),
), ),
), ),
),
); );
expect(semantics, hasSemantics( expect(semantics, hasSemantics(
...@@ -908,7 +904,6 @@ void main() { ...@@ -908,7 +904,6 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: MediaQuery( child: MediaQuery(
data: const MediaQueryData(), data: const MediaQueryData(),
child: Center( child: Center(
...@@ -919,7 +914,6 @@ void main() { ...@@ -919,7 +914,6 @@ void main() {
), ),
), ),
), ),
),
); );
expect(tester.getSize(find.byType(OutlineButton)), equals(const Size(88.0, 48.0))); expect(tester.getSize(find.byType(OutlineButton)), equals(const Size(88.0, 48.0)));
...@@ -929,7 +923,6 @@ void main() { ...@@ -929,7 +923,6 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: MediaQuery( child: MediaQuery(
data: const MediaQueryData(textScaleFactor: 1.3), data: const MediaQueryData(textScaleFactor: 1.3),
child: Center( child: Center(
...@@ -940,7 +933,6 @@ void main() { ...@@ -940,7 +933,6 @@ void main() {
), ),
), ),
), ),
),
); );
expect(tester.getSize(find.byType(FlatButton)), equals(const Size(88.0, 48.0))); expect(tester.getSize(find.byType(FlatButton)), equals(const Size(88.0, 48.0)));
...@@ -953,7 +945,6 @@ void main() { ...@@ -953,7 +945,6 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: MediaQuery( child: MediaQuery(
data: const MediaQueryData(textScaleFactor: 3.0), data: const MediaQueryData(textScaleFactor: 3.0),
child: Center( child: Center(
...@@ -964,7 +955,6 @@ void main() { ...@@ -964,7 +955,6 @@ void main() {
), ),
), ),
), ),
),
); );
// Scaled text rendering is different on Linux and Mac by one pixel. // Scaled text rendering is different on Linux and Mac by one pixel.
...@@ -1043,7 +1033,6 @@ void main() { ...@@ -1043,7 +1033,6 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: Center( child: Center(
child: OutlineButton( child: OutlineButton(
materialTapTargetSize: MaterialTapTargetSize.padded, materialTapTargetSize: MaterialTapTargetSize.padded,
...@@ -1052,7 +1041,6 @@ void main() { ...@@ -1052,7 +1041,6 @@ void main() {
), ),
), ),
), ),
),
); );
// Default Width of OutlineButton with MaterialTapTargetSize (88) // Default Width of OutlineButton with MaterialTapTargetSize (88)
...@@ -1061,7 +1049,6 @@ void main() { ...@@ -1061,7 +1049,6 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: Center( child: Center(
child: OutlineButton( child: OutlineButton(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
...@@ -1070,7 +1057,6 @@ void main() { ...@@ -1070,7 +1057,6 @@ void main() {
), ),
), ),
), ),
),
); );
// Default Width of OutlineButton with MaterialTapTargetSize (88) // Default Width of OutlineButton with MaterialTapTargetSize (88)
...@@ -1080,7 +1066,6 @@ void main() { ...@@ -1080,7 +1066,6 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: Center( child: Center(
child: OutlineButton.icon( child: OutlineButton.icon(
key: key1, key: key1,
...@@ -1091,7 +1076,6 @@ void main() { ...@@ -1091,7 +1076,6 @@ void main() {
), ),
), ),
), ),
),
); );
final Size addAlarmIconSize = tester.getSize(find.byIcon(Icons.add_alarm)); final Size addAlarmIconSize = tester.getSize(find.byIcon(Icons.add_alarm));
...@@ -1107,7 +1091,6 @@ void main() { ...@@ -1107,7 +1091,6 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: Center( child: Center(
child: OutlineButton.icon( child: OutlineButton.icon(
key: key2, key: key2,
...@@ -1118,7 +1101,6 @@ void main() { ...@@ -1118,7 +1101,6 @@ void main() {
), ),
), ),
), ),
),
); );
// The expected width is the sum of: // The expected width is the sum of:
......
...@@ -617,8 +617,7 @@ void main() { ...@@ -617,8 +617,7 @@ void main() {
final GlobalKey childKey = GlobalKey(); final GlobalKey childKey = GlobalKey();
bool hovering = false; bool hovering = false;
await tester.pumpWidget( await tester.pumpWidget(
Material( Directionality(
child: Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: SizedBox( child: SizedBox(
width: 100, width: 100,
...@@ -633,7 +632,6 @@ void main() { ...@@ -633,7 +632,6 @@ void main() {
), ),
), ),
), ),
),
); );
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(focusNode.hasPrimaryFocus, isTrue); expect(focusNode.hasPrimaryFocus, isTrue);
...@@ -645,8 +643,7 @@ void main() { ...@@ -645,8 +643,7 @@ void main() {
expect(hovering, isTrue); expect(hovering, isTrue);
await tester.pumpWidget( await tester.pumpWidget(
Material( Directionality(
child: Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: SizedBox( child: SizedBox(
width: 100, width: 100,
...@@ -659,7 +656,6 @@ void main() { ...@@ -659,7 +656,6 @@ void main() {
), ),
), ),
), ),
),
); );
await tester.pumpAndSettle(); await tester.pumpAndSettle();
...@@ -671,8 +667,7 @@ void main() { ...@@ -671,8 +667,7 @@ void main() {
late bool hover; late bool hover;
Widget buildFrame({ required bool enabled }) { Widget buildFrame({ required bool enabled }) {
return Material( return Directionality(
child: Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Center( child: Center(
child: SizedBox( child: SizedBox(
...@@ -688,7 +683,6 @@ void main() { ...@@ -688,7 +683,6 @@ void main() {
), ),
), ),
), ),
),
); );
} }
...@@ -735,8 +729,7 @@ void main() { ...@@ -735,8 +729,7 @@ void main() {
final FocusNode node = FocusNode(debugLabel: 'OutlinedButton Focus'); final FocusNode node = FocusNode(debugLabel: 'OutlinedButton Focus');
bool gotFocus = false; bool gotFocus = false;
await tester.pumpWidget( await tester.pumpWidget(
Material( Directionality(
child: Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: OutlinedButton( child: OutlinedButton(
focusNode: node, focusNode: node,
...@@ -745,7 +738,6 @@ void main() { ...@@ -745,7 +738,6 @@ void main() {
child: const SizedBox(), child: const SizedBox(),
), ),
), ),
),
); );
node.requestFocus(); node.requestFocus();
...@@ -766,8 +758,7 @@ void main() { ...@@ -766,8 +758,7 @@ void main() {
final FocusNode node = FocusNode(debugLabel: 'OutlinedButton Focus'); final FocusNode node = FocusNode(debugLabel: 'OutlinedButton Focus');
bool gotFocus = false; bool gotFocus = false;
await tester.pumpWidget( await tester.pumpWidget(
Material( Directionality(
child: Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: OutlinedButton( child: OutlinedButton(
focusNode: node, focusNode: node,
...@@ -776,7 +767,6 @@ void main() { ...@@ -776,7 +767,6 @@ void main() {
child: const SizedBox(), child: const SizedBox(),
), ),
), ),
),
); );
node.requestFocus(); node.requestFocus();
...@@ -909,7 +899,6 @@ void main() { ...@@ -909,7 +899,6 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: Center( child: Center(
child: OutlinedButton( child: OutlinedButton(
key: buttonKey, key: buttonKey,
...@@ -918,7 +907,6 @@ void main() { ...@@ -918,7 +907,6 @@ void main() {
), ),
), ),
), ),
),
); );
expect( expect(
...@@ -933,7 +921,6 @@ void main() { ...@@ -933,7 +921,6 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: Center( child: Center(
child: OutlinedButton( child: OutlinedButton(
style: ButtonStyle( style: ButtonStyle(
...@@ -947,7 +934,6 @@ void main() { ...@@ -947,7 +934,6 @@ void main() {
), ),
), ),
), ),
),
); );
expect(semantics, hasSemantics( expect(semantics, hasSemantics(
...@@ -979,7 +965,6 @@ void main() { ...@@ -979,7 +965,6 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: MediaQuery( child: MediaQuery(
data: const MediaQueryData(), data: const MediaQueryData(),
child: Center( child: Center(
...@@ -996,7 +981,6 @@ void main() { ...@@ -996,7 +981,6 @@ void main() {
), ),
), ),
), ),
),
); );
expect(tester.getSize(find.byType(OutlinedButton)), equals(const Size(88.0, 48.0))); expect(tester.getSize(find.byType(OutlinedButton)), equals(const Size(88.0, 48.0)));
...@@ -1006,7 +990,6 @@ void main() { ...@@ -1006,7 +990,6 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: MediaQuery( child: MediaQuery(
data: const MediaQueryData(textScaleFactor: 1.3), data: const MediaQueryData(textScaleFactor: 1.3),
child: Center( child: Center(
...@@ -1023,7 +1006,6 @@ void main() { ...@@ -1023,7 +1006,6 @@ void main() {
), ),
), ),
), ),
),
); );
expect(tester.getSize(find.byType(OutlinedButton)), equals(const Size(88.0, 48.0))); expect(tester.getSize(find.byType(OutlinedButton)), equals(const Size(88.0, 48.0)));
...@@ -1036,7 +1018,6 @@ void main() { ...@@ -1036,7 +1018,6 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: MediaQuery( child: MediaQuery(
data: const MediaQueryData(textScaleFactor: 3.0), data: const MediaQueryData(textScaleFactor: 3.0),
child: Center( child: Center(
...@@ -1047,7 +1028,6 @@ void main() { ...@@ -1047,7 +1028,6 @@ void main() {
), ),
), ),
), ),
),
); );
// Scaled text rendering is different on Linux and Mac by one pixel. // Scaled text rendering is different on Linux and Mac by one pixel.
......
...@@ -529,7 +529,6 @@ void main() { ...@@ -529,7 +529,6 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: Center( child: Center(
child: RaisedButton( child: RaisedButton(
onPressed: () { }, onPressed: () { },
...@@ -537,7 +536,6 @@ void main() { ...@@ -537,7 +536,6 @@ void main() {
), ),
), ),
), ),
),
); );
expect(semantics, hasSemantics( expect(semantics, hasSemantics(
...@@ -572,7 +570,6 @@ void main() { ...@@ -572,7 +570,6 @@ void main() {
data: ThemeData(materialTapTargetSize: MaterialTapTargetSize.padded), data: ThemeData(materialTapTargetSize: MaterialTapTargetSize.padded),
child: Directionality( child: Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: Center( child: Center(
child: RaisedButton( child: RaisedButton(
key: key1, key: key1,
...@@ -582,7 +579,6 @@ void main() { ...@@ -582,7 +579,6 @@ void main() {
), ),
), ),
), ),
),
); );
expect(tester.getSize(find.byKey(key1)), const Size(88.0, 48.0)); expect(tester.getSize(find.byKey(key1)), const Size(88.0, 48.0));
...@@ -593,7 +589,6 @@ void main() { ...@@ -593,7 +589,6 @@ void main() {
data: ThemeData(materialTapTargetSize: MaterialTapTargetSize.shrinkWrap), data: ThemeData(materialTapTargetSize: MaterialTapTargetSize.shrinkWrap),
child: Directionality( child: Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: Center( child: Center(
child: RaisedButton( child: RaisedButton(
key: key2, key: key2,
...@@ -603,7 +598,6 @@ void main() { ...@@ -603,7 +598,6 @@ void main() {
), ),
), ),
), ),
),
); );
expect(tester.getSize(find.byKey(key2)), const Size(88.0, 36.0)); expect(tester.getSize(find.byKey(key2)), const Size(88.0, 36.0));
...@@ -613,12 +607,10 @@ void main() { ...@@ -613,12 +607,10 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: RaisedButton( child: RaisedButton(
onPressed: () { /* to make sure the button is enabled */ }, onPressed: () { /* to make sure the button is enabled */ },
), ),
), ),
),
); );
expect( expect(
...@@ -696,7 +688,6 @@ void main() { ...@@ -696,7 +688,6 @@ void main() {
// horizontal padding is applied correctly later on // horizontal padding is applied correctly later on
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: Center( child: Center(
child: RaisedButton.icon( child: RaisedButton.icon(
icon: const Icon(Icons.add), icon: const Icon(Icons.add),
...@@ -710,7 +701,6 @@ void main() { ...@@ -710,7 +701,6 @@ void main() {
), ),
), ),
), ),
),
); );
final Rect paddingRect = tester.getRect(find.byType(Padding)); final Rect paddingRect = tester.getRect(find.byType(Padding));
......
...@@ -395,13 +395,11 @@ void main() { ...@@ -395,13 +395,11 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: TextButton( child: TextButton(
child: Container(), child: Container(),
onPressed: () { /* to make sure the button is enabled */ }, onPressed: () { /* to make sure the button is enabled */ },
), ),
), ),
),
); );
expect( expect(
...@@ -420,7 +418,6 @@ void main() { ...@@ -420,7 +418,6 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: TextButton( child: TextButton(
style: ButtonStyle( style: ButtonStyle(
overlayColor: MaterialStateProperty.resolveWith<Color?>(getOverlayColor), overlayColor: MaterialStateProperty.resolveWith<Color?>(getOverlayColor),
...@@ -429,7 +426,6 @@ void main() { ...@@ -429,7 +426,6 @@ void main() {
onPressed: () { /* to make sure the button is enabled */ }, onPressed: () { /* to make sure the button is enabled */ },
), ),
), ),
),
); );
...@@ -478,7 +474,6 @@ void main() { ...@@ -478,7 +474,6 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: Center( child: Center(
child: TextButton( child: TextButton(
style: ButtonStyle( style: ButtonStyle(
...@@ -492,7 +487,6 @@ void main() { ...@@ -492,7 +487,6 @@ void main() {
), ),
), ),
), ),
),
); );
expect(semantics, hasSemantics( expect(semantics, hasSemantics(
...@@ -524,7 +518,6 @@ void main() { ...@@ -524,7 +518,6 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: MediaQuery( child: MediaQuery(
data: const MediaQueryData(), data: const MediaQueryData(),
child: Center( child: Center(
...@@ -535,7 +528,6 @@ void main() { ...@@ -535,7 +528,6 @@ void main() {
), ),
), ),
), ),
),
); );
expect(tester.getSize(find.byType(TextButton)), equals(const Size(64.0, 48.0))); expect(tester.getSize(find.byType(TextButton)), equals(const Size(64.0, 48.0)));
...@@ -545,7 +537,6 @@ void main() { ...@@ -545,7 +537,6 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: MediaQuery( child: MediaQuery(
data: const MediaQueryData(textScaleFactor: 1.3), data: const MediaQueryData(textScaleFactor: 1.3),
child: Center( child: Center(
...@@ -556,7 +547,6 @@ void main() { ...@@ -556,7 +547,6 @@ void main() {
), ),
), ),
), ),
),
); );
// Scaled text rendering is different on Linux and Mac by one pixel. // Scaled text rendering is different on Linux and Mac by one pixel.
...@@ -570,7 +560,6 @@ void main() { ...@@ -570,7 +560,6 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: MediaQuery( child: MediaQuery(
data: const MediaQueryData(textScaleFactor: 3.0), data: const MediaQueryData(textScaleFactor: 3.0),
child: Center( child: Center(
...@@ -581,7 +570,6 @@ void main() { ...@@ -581,7 +570,6 @@ void main() {
), ),
), ),
), ),
),
); );
// Scaled text rendering is different on Linux and Mac by one pixel. // Scaled text rendering is different on Linux and Mac by one pixel.
...@@ -599,7 +587,6 @@ void main() { ...@@ -599,7 +587,6 @@ void main() {
data: ThemeData(materialTapTargetSize: tapTargetSize), data: ThemeData(materialTapTargetSize: tapTargetSize),
child: Directionality( child: Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material(
child: Center( child: Center(
child: TextButton( child: TextButton(
key: key, key: key,
...@@ -608,7 +595,6 @@ void main() { ...@@ -608,7 +595,6 @@ void main() {
), ),
), ),
), ),
),
); );
} }
...@@ -701,8 +687,7 @@ void main() { ...@@ -701,8 +687,7 @@ void main() {
final GlobalKey childKey = GlobalKey(); final GlobalKey childKey = GlobalKey();
bool hovering = false; bool hovering = false;
await tester.pumpWidget( await tester.pumpWidget(
Material( Directionality(
child: Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: SizedBox( child: SizedBox(
width: 100, width: 100,
...@@ -717,7 +702,6 @@ void main() { ...@@ -717,7 +702,6 @@ void main() {
), ),
), ),
), ),
),
); );
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(focusNode.hasPrimaryFocus, isTrue); expect(focusNode.hasPrimaryFocus, isTrue);
...@@ -729,8 +713,7 @@ void main() { ...@@ -729,8 +713,7 @@ void main() {
expect(hovering, isTrue); expect(hovering, isTrue);
await tester.pumpWidget( await tester.pumpWidget(
Material( Directionality(
child: Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: SizedBox( child: SizedBox(
width: 100, width: 100,
...@@ -743,7 +726,6 @@ void main() { ...@@ -743,7 +726,6 @@ void main() {
), ),
), ),
), ),
),
); );
await tester.pumpAndSettle(); await tester.pumpAndSettle();
...@@ -755,8 +737,7 @@ void main() { ...@@ -755,8 +737,7 @@ void main() {
late bool hover; late bool hover;
Widget buildFrame({ required bool enabled }) { Widget buildFrame({ required bool enabled }) {
return Material( return Directionality(
child: Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Center( child: Center(
child: SizedBox( child: SizedBox(
...@@ -772,7 +753,6 @@ void main() { ...@@ -772,7 +753,6 @@ void main() {
), ),
), ),
), ),
),
); );
} }
...@@ -819,8 +799,7 @@ void main() { ...@@ -819,8 +799,7 @@ void main() {
final FocusNode node = FocusNode(debugLabel: 'TextButton Focus'); final FocusNode node = FocusNode(debugLabel: 'TextButton Focus');
bool gotFocus = false; bool gotFocus = false;
await tester.pumpWidget( await tester.pumpWidget(
Material( Directionality(
child: Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: TextButton( child: TextButton(
focusNode: node, focusNode: node,
...@@ -829,7 +808,6 @@ void main() { ...@@ -829,7 +808,6 @@ void main() {
child: const SizedBox(), child: const SizedBox(),
), ),
), ),
),
); );
node.requestFocus(); node.requestFocus();
...@@ -850,8 +828,7 @@ void main() { ...@@ -850,8 +828,7 @@ void main() {
final FocusNode node = FocusNode(debugLabel: 'TextButton Focus'); final FocusNode node = FocusNode(debugLabel: 'TextButton Focus');
bool gotFocus = false; bool gotFocus = false;
await tester.pumpWidget( await tester.pumpWidget(
Material( Directionality(
child: Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: TextButton( child: TextButton(
focusNode: node, focusNode: node,
...@@ -860,7 +837,6 @@ void main() { ...@@ -860,7 +837,6 @@ void main() {
child: const SizedBox(), child: const SizedBox(),
), ),
), ),
),
); );
node.requestFocus(); node.requestFocus();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment