Remove double MaterialApp wrap from api samples (#150055)
The widget under test already contains a MaterialApp, so there's no need to wrap it again with one in the test. In fact, the additional MaterialApp could hide problems in the widget under test.
This commit is contained in:
committed by
GitHub
parent
1f93809ad2
commit
962ae8a334
@@ -13,11 +13,7 @@ void main() {
|
||||
return tester.widget<TextButton>(find.widgetWithText(TextButton, text));
|
||||
}
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(
|
||||
home: Scaffold(
|
||||
body: example.ToggleButtonsExampleApp(),
|
||||
),
|
||||
),
|
||||
const example.ToggleButtonsExampleApp(),
|
||||
);
|
||||
|
||||
TextButton firstButton = findButton('Apple');
|
||||
@@ -51,11 +47,7 @@ void main() {
|
||||
return tester.widget<TextButton>(find.widgetWithText(TextButton, text));
|
||||
}
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(
|
||||
home: Scaffold(
|
||||
body: example.ToggleButtonsExampleApp(),
|
||||
),
|
||||
),
|
||||
const example.ToggleButtonsExampleApp(),
|
||||
);
|
||||
|
||||
TextButton firstButton = findButton('Tomatoes');
|
||||
@@ -90,11 +82,7 @@ void main() {
|
||||
return tester.widget<TextButton>(find.widgetWithIcon(TextButton, iconData));
|
||||
}
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(
|
||||
home: Scaffold(
|
||||
body: example.ToggleButtonsExampleApp(),
|
||||
),
|
||||
),
|
||||
const example.ToggleButtonsExampleApp(),
|
||||
);
|
||||
|
||||
TextButton firstButton = findButton(Icons.sunny);
|
||||
|
||||
Reference in New Issue
Block a user