@@ -8,7 +8,7 @@ import 'package:flutter_test/flutter_test.dart';
88
99void main () {
1010 testWidgets ('debugCheckHasMaterial control test' , (WidgetTester tester) async {
11- await tester.pumpWidget (const Center (child : Chip (label: Text ('label' ) )));
11+ await tester.pumpWidget (const Chip (label: Text ('label' )));
1212 final dynamic exception = tester.takeException ();
1313 expect (exception, isFlutterError);
1414 final FlutterError error = exception as FlutterError ;
@@ -25,7 +25,7 @@ void main() {
2525 expect (error.diagnostics[3 ], isA <DiagnosticsProperty <Element >>());
2626 expect (error.diagnostics[4 ], isA <DiagnosticsBlock >());
2727 expect (
28- error.toStringDeep (), startsWith (
28+ error.toStringDeep (),
2929 'FlutterError\n '
3030 ' No Material widget found.\n '
3131 ' Chip widgets require a Material widget ancestor within the\n '
@@ -42,13 +42,12 @@ void main() {
4242 ' The specific widget that could not find a Material ancestor was:\n '
4343 ' Chip\n '
4444 ' The ancestors of this widget were:\n '
45- ' Center\n '
46- // End of ancestor chain omitted, not relevant for test.
47- ));
45+ ' [root]\n ' ,
46+ );
4847 });
4948
5049 testWidgets ('debugCheckHasMaterialLocalizations control test' , (WidgetTester tester) async {
51- await tester.pumpWidget (const Center (child : BackButton () ));
50+ await tester.pumpWidget (const BackButton ());
5251 final dynamic exception = tester.takeException ();
5352 expect (exception, isFlutterError);
5453 final FlutterError error = exception as FlutterError ;
@@ -65,7 +64,7 @@ void main() {
6564 expect (error.diagnostics[4 ], isA <DiagnosticsProperty <Element >>());
6665 expect (error.diagnostics[5 ], isA <DiagnosticsBlock >());
6766 expect (
68- error.toStringDeep (), startsWith (
67+ error.toStringDeep (),
6968 'FlutterError\n '
7069 ' No MaterialLocalizations found.\n '
7170 ' BackButton widgets require MaterialLocalizations to be provided\n '
@@ -79,9 +78,8 @@ void main() {
7978 ' ancestor was:\n '
8079 ' BackButton\n '
8180 ' The ancestors of this widget were:\n '
82- ' Center\n '
83- // End of ancestor chain omitted, not relevant for test.
84- ));
81+ ' [root]\n ' ,
82+ );
8583 });
8684
8785 testWidgets ('debugCheckHasScaffold control test' , (WidgetTester tester) async {
@@ -235,7 +233,6 @@ void main() {
235233 ' HeroControllerScope\n '
236234 ' ScrollConfiguration\n '
237235 ' MaterialApp\n '
238- ' View-[GlobalObjectKey TestWindow#00000]\n '
239236 ' [root]\n '
240237 ' Typically, the Scaffold widget is introduced by the MaterialApp\n '
241238 ' or WidgetsApp widget at the top of your application widget tree.\n '
@@ -380,7 +377,6 @@ void main() {
380377 ' Scaffold-[LabeledGlobalKey<ScaffoldState>#00000]\n '
381378 ' MediaQuery\n '
382379 ' Directionality\n '
383- ' View-[GlobalObjectKey TestWindow#00000]\n '
384380 ' [root]\n '
385381 ' Typically, the ScaffoldMessenger widget is introduced by the\n '
386382 ' MaterialApp at the top of your application widget tree.\n '
0 commit comments