Unverified Commit f5be639e authored by Kate Lovett's avatar Kate Lovett Committed by GitHub

Revert "Refactor `ToggleButtons` (remove `RawMaterialButton`) (#99493)" (#101536)

This reverts commit 0b216f7a.
parent b528310f
......@@ -142,7 +142,7 @@ void main() {
TextStyle textStyle;
textStyle = tester.widget<DefaultTextStyle>(find.descendant(
of: find.widgetWithText(TextButton, 'First child'),
of: find.widgetWithText(RawMaterialButton, 'First child'),
matching: find.byType(DefaultTextStyle),
)).style;
expect(textStyle.textBaseline, TextBaseline.ideographic);
......@@ -150,7 +150,7 @@ void main() {
expect(textStyle.color, isNot(Colors.orange));
textStyle = tester.widget<DefaultTextStyle>(find.descendant(
of: find.widgetWithText(TextButton, 'Second child'),
of: find.widgetWithText(RawMaterialButton, 'Second child'),
matching: find.byType(DefaultTextStyle),
)).style;
expect(textStyle.textBaseline, TextBaseline.ideographic);
......@@ -171,7 +171,6 @@ void main() {
),
),
child: ToggleButtons(
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
isSelected: const <bool>[false, false, false],
onPressed: (int index) {},
children: const <Widget>[
......@@ -185,13 +184,13 @@ void main() {
),
);
Rect firstRect = tester.getRect(find.byType(TextButton).at(0));
Rect firstRect = tester.getRect(find.byType(RawMaterialButton).at(0));
expect(firstRect.width, 50.0);
expect(firstRect.height, 60.0);
Rect secondRect = tester.getRect(find.byType(TextButton).at(1));
Rect secondRect = tester.getRect(find.byType(RawMaterialButton).at(1));
expect(secondRect.width, 50.0);
expect(secondRect.height, 60.0);
Rect thirdRect = tester.getRect(find.byType(TextButton).at(2));
Rect thirdRect = tester.getRect(find.byType(RawMaterialButton).at(2));
expect(thirdRect.width, 50.0);
expect(thirdRect.height, 60.0);
......@@ -207,7 +206,6 @@ void main() {
),
),
child: ToggleButtons(
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
isSelected: const <bool>[false, false, false],
onPressed: (int index) {},
children: const <Widget>[
......@@ -221,13 +219,13 @@ void main() {
),
);
firstRect = tester.getRect(find.byType(TextButton).at(0));
firstRect = tester.getRect(find.byType(RawMaterialButton).at(0));
expect(firstRect.width, 20.0);
expect(firstRect.height, 10.0);
secondRect = tester.getRect(find.byType(TextButton).at(1));
secondRect = tester.getRect(find.byType(RawMaterialButton).at(1));
expect(secondRect.width, 20.0);
expect(secondRect.height, 10.0);
thirdRect = tester.getRect(find.byType(TextButton).at(2));
thirdRect = tester.getRect(find.byType(RawMaterialButton).at(2));
expect(thirdRect.width, 20.0);
expect(thirdRect.height, 10.0);
});
......@@ -237,13 +235,13 @@ void main() {
(WidgetTester tester) async {
TextStyle buttonTextStyle(String text) {
return tester.widget<DefaultTextStyle>(find.descendant(
of: find.widgetWithText(TextButton, text),
of: find.widgetWithText(RawMaterialButton, text),
matching: find.byType(DefaultTextStyle),
)).style;
}
IconTheme iconTheme(IconData icon) {
return tester.widget(find.descendant(
of: find.widgetWithIcon(TextButton, icon),
of: find.widgetWithIcon(RawMaterialButton, icon),
matching: find.byType(IconTheme),
));
}
......@@ -358,7 +356,7 @@ void main() {
);
final Material material = tester.widget<Material>(find.descendant(
of: find.byType(TextButton),
of: find.byType(RawMaterialButton),
matching: find.byType(Material),
));
expect(material.color, customFillColor);
......@@ -369,7 +367,7 @@ void main() {
Material buttonColor(String text) {
return tester.widget<Material>(
find.descendant(
of: find.byType(TextButton),
of: find.byType(RawMaterialButton),
matching: find.widgetWithText(Material, text),
),
);
......@@ -478,6 +476,7 @@ void main() {
inkFeatures,
paints
..circle(color: splashColor)
..rect(color: highlightColor),
);
await touchGesture.up();
......@@ -508,6 +507,7 @@ void main() {
await hoverGesture.removePointer();
});
testWidgets(
'Theme border width and border colors for enabled, selected and disabled states',
(WidgetTester tester) async {
......
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