Cross imports cleanups (#181611)

This PR cleans up a bunch of files for the cross imports, in one big
change, per offline discussion.

The following files have been fixed:

- debug_test.dart
- dual_transition_builder_test.dart
- listener_test.dart
- placeholder_test.dart
- rotated_box_test.dart
- run_app_async_test.dart
- run_app_test.dart
- scroll_activity_test.dart
- scroll_position_test.dart
- scrollable_dispose_test.dart
- semantics_test.dart
- shape_decoration_test.dart
- simple_semantics_test.dart
- sliver_list_test.dart
- slivers_padding_test.dart
- syncing_test.dart
- text_semantics_test.dart

Part of https://github.com/flutter/flutter/issues/177415

*If you had to change anything in the [flutter/tests] repo, include a
link to the migration guide as per the [breaking change policy].*

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
diff --git a/dev/bots/check_tests_cross_imports.dart b/dev/bots/check_tests_cross_imports.dart
index 9e9281d..9730ea6 100644
--- a/dev/bots/check_tests_cross_imports.dart
+++ b/dev/bots/check_tests_cross_imports.dart
@@ -125,17 +125,14 @@
     'packages/flutter/test/widgets/draggable_scrollable_sheet_test.dart',
     'packages/flutter/test/widgets/autofill_group_test.dart',
     'packages/flutter/test/widgets/range_maintaining_scroll_physics_test.dart',
-    'packages/flutter/test/widgets/scroll_position_test.dart',
     'packages/flutter/test/widgets/interactive_viewer_test.dart',
     'packages/flutter/test/widgets/selectable_region_test.dart',
     'packages/flutter/test/widgets/editable_text_scribe_test.dart',
     'packages/flutter/test/widgets/scrollable_test.dart',
     'packages/flutter/test/widgets/semantics_debugger_test.dart',
-    'packages/flutter/test/widgets/semantics_test.dart',
     'packages/flutter/test/widgets/page_route_builder_test.dart',
     'packages/flutter/test/widgets/two_dimensional_scroll_view_test.dart',
     'packages/flutter/test/widgets/routes_test.dart',
-    'packages/flutter/test/widgets/listener_test.dart',
     'packages/flutter/test/widgets/text_selection_test.dart',
     'packages/flutter/test/widgets/app_test.dart',
     'packages/flutter/test/widgets/widget_inspector_test.dart',
@@ -149,15 +146,11 @@
     'packages/flutter/test/widgets/semantics_merge_test.dart',
     'packages/flutter/test/widgets/modal_barrier_test.dart',
     'packages/flutter/test/widgets/sliver_semantics_test.dart',
-    'packages/flutter/test/widgets/slivers_padding_test.dart',
     'packages/flutter/test/widgets/sliver_constraints_test.dart',
     'packages/flutter/test/widgets/autocomplete_test.dart',
     'packages/flutter/test/widgets/decorated_sliver_test.dart',
-    'packages/flutter/test/widgets/shape_decoration_test.dart',
-    'packages/flutter/test/widgets/run_app_test.dart',
     'packages/flutter/test/widgets/shadow_test.dart',
     'packages/flutter/test/widgets/routes_transition_test.dart',
-    'packages/flutter/test/widgets/placeholder_test.dart',
     'packages/flutter/test/widgets/route_notification_messages_test.dart',
     'packages/flutter/test/widgets/animated_cross_fade_test.dart',
     'packages/flutter/test/widgets/editable_text_shortcuts_test.dart',
@@ -165,11 +158,9 @@
     'packages/flutter/test/widgets/scroll_notification_test.dart',
     'packages/flutter/test/widgets/magnifier_test.dart',
     'packages/flutter/test/widgets/editable_text_test.dart',
-    'packages/flutter/test/widgets/dual_transition_builder_test.dart',
     'packages/flutter/test/widgets/icon_test.dart',
     'packages/flutter/test/widgets/sliver_cross_axis_group_test.dart',
     'packages/flutter/test/widgets/list_wheel_scroll_view_test.dart',
-    'packages/flutter/test/widgets/scrollable_dispose_test.dart',
     'packages/flutter/test/widgets/pop_scope_test.dart',
     'packages/flutter/test/widgets/scrollbar_test.dart',
     'packages/flutter/test/widgets/actions_test.dart',
@@ -191,9 +182,7 @@
     'packages/flutter/test/widgets/editable_text_show_on_screen_test.dart',
     'packages/flutter/test/widgets/system_context_menu_test.dart',
     'packages/flutter/test/widgets/scrollable_fling_test.dart',
-    'packages/flutter/test/widgets/debug_test.dart',
     'packages/flutter/test/widgets/transformed_scrollable_test.dart',
-    'packages/flutter/test/widgets/run_app_async_test.dart',
     'packages/flutter/test/widgets/scrollable_in_overlay_test.dart',
     'packages/flutter/test/widgets/navigator_and_layers_test.dart',
     'packages/flutter/test/widgets/snapshot_widget_test.dart',
@@ -207,33 +196,27 @@
     'packages/flutter/test/widgets/page_transitions_builder_test.dart',
     'packages/flutter/test/widgets/selectable_region_context_menu_test.dart',
     'packages/flutter/test/widgets/sliversemantics_test.dart',
-    'packages/flutter/test/widgets/scroll_activity_test.dart',
     'packages/flutter/test/widgets/tap_region_test.dart',
     'packages/flutter/test/widgets/lookup_boundary_test.dart',
     'packages/flutter/test/widgets/html_element_view_test.dart',
     'packages/flutter/test/widgets/navigator_test.dart',
-    'packages/flutter/test/widgets/text_semantics_test.dart',
     'packages/flutter/test/widgets/safe_area_test.dart',
     'packages/flutter/test/widgets/page_view_test.dart',
     'packages/flutter/test/widgets/undo_history_test.dart',
     'packages/flutter/test/widgets/scroll_view_test.dart',
-    'packages/flutter/test/widgets/sliver_list_test.dart',
     'packages/flutter/test/widgets/page_forward_transitions_test.dart',
     'packages/flutter/test/widgets/context_menu_controller_test.dart',
     'packages/flutter/test/widgets/slivers_test.dart',
     'packages/flutter/test/widgets/navigator_restoration_test.dart',
     'packages/flutter/test/widgets/sliver_prototype_item_extent_test.dart',
-    'packages/flutter/test/widgets/simple_semantics_test.dart',
     'packages/flutter/test/widgets/image_filter_test.dart',
     'packages/flutter/test/widgets/navigator_on_did_remove_page_test.dart',
     'packages/flutter/test/widgets/baseline_test.dart',
     'packages/flutter/test/widgets/selection_container_test.dart',
     'packages/flutter/test/widgets/scrollable_semantics_test.dart',
-    'packages/flutter/test/widgets/rotated_box_test.dart',
     'packages/flutter/test/widgets/single_child_scroll_view_test.dart',
     'packages/flutter/test/widgets/pinned_header_sliver_test.dart',
     'packages/flutter/test/widgets/raw_radio_test.dart',
-    'packages/flutter/test/widgets/syncing_test.dart',
     'packages/flutter/test/widgets/form_test.dart',
   };
 
diff --git a/packages/flutter/test/widgets/debug_test.dart b/packages/flutter/test/widgets/debug_test.dart
index 0bd946c..d2e3862 100644
--- a/packages/flutter/test/widgets/debug_test.dart
+++ b/packages/flutter/test/widgets/debug_test.dart
@@ -5,9 +5,11 @@
 import 'dart:ui';
 
 import 'package:flutter/foundation.dart';
-import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
 import 'package:flutter_test/flutter_test.dart';
 
+import 'widgets_app_tester.dart';
+
 void main() {
   test('debugChildrenHaveDuplicateKeys control test', () {
     const key = Key('key');
@@ -272,36 +274,34 @@
 
   testWidgets('debugCreator of layers should not be null', (WidgetTester tester) async {
     await tester.pumpWidget(
-      MaterialApp(
+      TestWidgetsApp(
         home: Directionality(
           textDirection: TextDirection.ltr,
-          child: Material(
-            child: Stack(
-              children: <Widget>[
-                const ColorFiltered(
-                  colorFilter: ColorFilter.mode(Color(0xFFFF0000), BlendMode.color),
-                  child: Placeholder(),
-                ),
-                const Opacity(opacity: 0.9, child: Placeholder()),
-                ImageFiltered(
-                  imageFilter: ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0),
-                  child: const Placeholder(),
-                ),
-                BackdropFilter(
-                  filter: ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0),
-                  child: const Placeholder(),
-                ),
-                ShaderMask(
-                  shaderCallback: (Rect bounds) => const RadialGradient(
-                    radius: 0.05,
-                    colors: <Color>[Color(0xFFFF0000), Color(0xFF00FF00)],
-                    tileMode: TileMode.mirror,
-                  ).createShader(bounds),
-                  child: const Placeholder(),
-                ),
-                CompositedTransformFollower(link: LayerLink()),
-              ],
-            ),
+          child: Stack(
+            children: <Widget>[
+              const ColorFiltered(
+                colorFilter: ColorFilter.mode(Color(0xFFFF0000), BlendMode.color),
+                child: Placeholder(),
+              ),
+              const Opacity(opacity: 0.9, child: Placeholder()),
+              ImageFiltered(
+                imageFilter: ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0),
+                child: const Placeholder(),
+              ),
+              BackdropFilter(
+                filter: ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0),
+                child: const Placeholder(),
+              ),
+              ShaderMask(
+                shaderCallback: (Rect bounds) => const RadialGradient(
+                  radius: 0.05,
+                  colors: <Color>[Color(0xFFFF0000), Color(0xFF00FF00)],
+                  tileMode: TileMode.mirror,
+                ).createShader(bounds),
+                child: const Placeholder(),
+              ),
+              CompositedTransformFollower(link: LayerLink()),
+            ],
           ),
         ),
       ),
diff --git a/packages/flutter/test/widgets/dual_transition_builder_test.dart b/packages/flutter/test/widgets/dual_transition_builder_test.dart
index d705cc7..854d81e 100644
--- a/packages/flutter/test/widgets/dual_transition_builder_test.dart
+++ b/packages/flutter/test/widgets/dual_transition_builder_test.dart
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
 import 'package:flutter_test/flutter_test.dart';
 
 void main() {
@@ -26,7 +26,7 @@
               child: child,
             );
           },
-          child: Container(color: Colors.green, height: 100, width: 100),
+          child: Container(color: const Color(0xFF00FF00), height: 100, width: 100),
         ),
       ),
     );
@@ -137,7 +137,7 @@
               child: child,
             );
           },
-          child: Container(color: Colors.green, height: 100, width: 100),
+          child: Container(color: const Color(0xFF00FF00), height: 100, width: 100),
         ),
       ),
     );
@@ -191,7 +191,7 @@
               child: child,
             );
           },
-          child: Container(color: Colors.green, height: 100, width: 100),
+          child: Container(color: const Color(0xFF00FF00), height: 100, width: 100),
         ),
       ),
     );
diff --git a/packages/flutter/test/widgets/listener_test.dart b/packages/flutter/test/widgets/listener_test.dart
index 0f308b1..f3ffc75 100644
--- a/packages/flutter/test/widgets/listener_test.dart
+++ b/packages/flutter/test/widgets/listener_test.dart
@@ -5,8 +5,8 @@
 import 'dart:math' as math;
 
 import 'package:flutter/gestures.dart';
-import 'package:flutter/material.dart';
 import 'package:flutter/rendering.dart';
+import 'package:flutter/widgets.dart';
 import 'package:flutter_test/flutter_test.dart';
 
 import 'gesture_utils.dart';
@@ -87,7 +87,7 @@
             onPointerSignal: (PointerSignalEvent event) {
               events.add(event);
             },
-            child: Container(key: key, color: Colors.red, height: 100, width: 100),
+            child: Container(key: key, color: const Color(0xFFFF0000), height: 100, width: 100),
           ),
         ),
       );
@@ -158,7 +158,7 @@
               onPointerSignal: (PointerSignalEvent event) {
                 events.add(event);
               },
-              child: Container(key: key, color: Colors.red, height: 100, width: 100),
+              child: Container(key: key, color: const Color(0xFFFF0000), height: 100, width: 100),
             ),
           ),
         ),
@@ -228,7 +228,7 @@
               onPointerSignal: (PointerSignalEvent event) {
                 events.add(event);
               },
-              child: Container(key: key, color: Colors.red, height: 100, width: 100),
+              child: Container(key: key, color: const Color(0xFFFF0000), height: 100, width: 100),
             ),
           ),
         ),
@@ -300,7 +300,7 @@
               onPointerSignal: (PointerSignalEvent event) {
                 events.add(event);
               },
-              child: Container(key: key, color: Colors.red, height: 100, width: 100),
+              child: Container(key: key, color: const Color(0xFFFF0000), height: 100, width: 100),
             ),
           ),
         ),
diff --git a/packages/flutter/test/widgets/placeholder_test.dart b/packages/flutter/test/widgets/placeholder_test.dart
index 1b097b6..d4e5798 100644
--- a/packages/flutter/test/widgets/placeholder_test.dart
+++ b/packages/flutter/test/widgets/placeholder_test.dart
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
 import 'package:flutter_test/flutter_test.dart';
 
 void main() {
@@ -59,7 +59,11 @@
   testWidgets('Placeholder child widget', (WidgetTester tester) async {
     await tester.pumpWidget(const Placeholder());
     expect(find.text('Label'), findsNothing);
-    await tester.pumpWidget(const MaterialApp(home: Placeholder(child: Text('Label'))));
+    await tester.pumpWidget(
+      const Placeholder(
+        child: Directionality(textDirection: TextDirection.ltr, child: Text('Label')),
+      ),
+    );
     expect(find.text('Label'), findsOneWidget);
   });
 }
diff --git a/packages/flutter/test/widgets/rotated_box_test.dart b/packages/flutter/test/widgets/rotated_box_test.dart
index 0abba49..df694c3 100644
--- a/packages/flutter/test/widgets/rotated_box_test.dart
+++ b/packages/flutter/test/widgets/rotated_box_test.dart
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
 import 'package:flutter_test/flutter_test.dart';
 
 void main() {
@@ -23,13 +23,13 @@
                 onTap: () {
                   log.add('left');
                 },
-                child: Container(width: 100.0, height: 40.0, color: Colors.blue[500]),
+                child: Container(width: 100.0, height: 40.0, color: const Color(0xFF0000FF)),
               ),
               GestureDetector(
                 onTap: () {
                   log.add('right');
                 },
-                child: Container(width: 75.0, height: 65.0, color: Colors.blue[500]),
+                child: Container(width: 75.0, height: 65.0, color: const Color(0xFF0000FF)),
               ),
             ],
           ),
diff --git a/packages/flutter/test/widgets/run_app_async_test.dart b/packages/flutter/test/widgets/run_app_async_test.dart
index be8ae06..bed5638 100644
--- a/packages/flutter/test/widgets/run_app_async_test.dart
+++ b/packages/flutter/test/widgets/run_app_async_test.dart
@@ -4,7 +4,7 @@
 
 import 'package:fake_async/fake_async.dart';
 import 'package:flutter/foundation.dart';
-import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
 import 'package:flutter_test/flutter_test.dart';
 
 // This test is very fragile and bypasses some zone-related checks.
@@ -44,7 +44,7 @@
   test('WidgetBinding build rendering tree and warm up frame back to back', () {
     final fakeAsync = FakeAsync();
     fakeAsync.run((FakeAsync async) {
-      runApp(const MaterialApp(home: Material(child: Text('test'))));
+      runApp(const Directionality(textDirection: TextDirection.ltr, child: Text('test')));
       // Rendering tree is not built synchronously.
       expect(WidgetsBinding.instance.rootElement, isNull);
       fakeAsync.flushTimers();
diff --git a/packages/flutter/test/widgets/run_app_test.dart b/packages/flutter/test/widgets/run_app_test.dart
index 49c0359..9c5664e 100644
--- a/packages/flutter/test/widgets/run_app_test.dart
+++ b/packages/flutter/test/widgets/run_app_test.dart
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
 import 'package:flutter_test/flutter_test.dart';
 
 void main() {
@@ -10,13 +10,11 @@
     await tester.pumpWidget(
       Directionality(
         textDirection: TextDirection.ltr,
-        child: Material(
-          child: ElevatedButton(
-            onPressed: () {
-              runApp(const Center(child: Text('Done', textDirection: TextDirection.ltr)));
-            },
-            child: const Text('GO'),
-          ),
+        child: GestureDetector(
+          onTap: () {
+            runApp(const Center(child: Text('Done', textDirection: TextDirection.ltr)));
+          },
+          child: const Text('GO'),
         ),
       ),
     );
diff --git a/packages/flutter/test/widgets/scroll_activity_test.dart b/packages/flutter/test/widgets/scroll_activity_test.dart
index 33b3209..51a7c37 100644
--- a/packages/flutter/test/widgets/scroll_activity_test.dart
+++ b/packages/flutter/test/widgets/scroll_activity_test.dart
@@ -3,12 +3,15 @@
 // found in the LICENSE file.
 
 import 'package:flutter/gestures.dart';
-import 'package:flutter/material.dart';
 import 'package:flutter/physics.dart';
 import 'package:flutter/scheduler.dart';
+import 'package:flutter/widgets.dart';
 import 'package:flutter_test/flutter_test.dart';
 import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart';
 
+import 'utils.dart';
+import 'widgets_app_tester.dart';
+
 List<Widget> children(int n) {
   return List<Widget>.generate(n, (int i) {
     return SizedBox(height: 100.0, child: Text('$i'));
@@ -22,7 +25,7 @@
     final controller = ScrollController();
     addTearDown(controller.dispose);
     await tester.pumpWidget(
-      MaterialApp(
+      TestWidgetsApp(
         home: ListView(controller: controller, children: children(30)),
       ),
     );
@@ -32,7 +35,7 @@
     controller.jumpTo(thirty + 100.0); // past the end
     await tester.pump();
     await tester.pumpWidget(
-      MaterialApp(
+      TestWidgetsApp(
         home: ListView(controller: controller, children: children(31)),
       ),
     );
@@ -50,7 +53,7 @@
     final controller = ScrollController();
     addTearDown(controller.dispose);
     await tester.pumpWidget(
-      MaterialApp(
+      TestWidgetsApp(
         home: ListView(controller: controller, children: children(30)),
       ),
     );
@@ -60,7 +63,7 @@
     controller.jumpTo(thirty + 200.0); // past the end
     await tester.pump();
     await tester.pumpWidget(
-      MaterialApp(
+      TestWidgetsApp(
         home: ListView(controller: controller, children: children(31)),
       ),
     );
@@ -126,7 +129,7 @@
   testWidgets('Ability to keep a PageView at the end manually (issue 62209)', (
     WidgetTester tester,
   ) async {
-    await tester.pumpWidget(const MaterialApp(home: PageView62209()));
+    await tester.pumpWidget(const TestWidgetsApp(home: PageView62209()));
     expect(find.text('Page 1'), findsOneWidget);
     expect(find.text('Page 100'), findsNothing);
     await tester.drag(find.byType(PageView62209), const Offset(-800.0, 0.0));
@@ -154,13 +157,13 @@
     expect(find.text('Page 1'), findsNothing);
     expect(find.text('Page 5'), findsNothing);
     expect(find.text('Page 100'), findsOneWidget);
-    await tester.tap(find.byType(TextButton)); // 6
+    await tester.tap(find.byType(TestButton)); // 6
     await tester.pump();
     expect(find.text('Page 1'), findsNothing);
     expect(find.text('Page 6'), findsNothing);
     expect(find.text('Page 5'), findsNothing);
     expect(find.text('Page 100'), findsOneWidget);
-    await tester.tap(find.byType(TextButton)); // 7
+    await tester.tap(find.byType(TestButton)); // 7
     await tester.pump();
     expect(find.text('Page 1'), findsNothing);
     expect(find.text('Page 6'), findsNothing);
@@ -178,7 +181,7 @@
     expect(find.text('Page 4'), findsOneWidget);
     expect(find.text('Page 5'), findsNothing);
     expect(find.text('Page 100'), findsNothing);
-    await tester.tap(find.byType(TextButton)); // 8
+    await tester.tap(find.byType(TestButton)); // 8
     await tester.pump();
     expect(find.text('Page 1'), findsNothing);
     expect(find.text('Page 8'), findsNothing);
@@ -203,7 +206,7 @@
     await tester.drag(find.byType(PageView62209), const Offset(800.0, 0.0));
     await tester.pump();
     expect(find.text('Page 1'), findsOneWidget);
-    await tester.tap(find.byType(TextButton)); // 9
+    await tester.tap(find.byType(TestButton)); // 9
     await tester.pump();
     expect(find.text('Page 1'), findsOneWidget);
     expect(find.text('Page 9'), findsNothing);
@@ -218,7 +221,7 @@
     int? lastTapped;
     int? lastHovered;
     await tester.pumpWidget(
-      MaterialApp(
+      TestWidgetsApp(
         home: ListView(
           controller: controller,
           children: List<Widget>.generate(30, (int i) {
@@ -382,23 +385,21 @@
 
   @override
   Widget build(BuildContext context) {
-    return Scaffold(
-      body: Column(
-        children: <Widget>[
-          Expanded(child: Carousel62209(pages: _pages)),
-          TextButton(
-            child: const Text('ADD PAGE'),
-            onPressed: () {
-              setState(() {
-                _pages.insert(
-                  1,
-                  Carousel62209Page(key: Key('$_nextPageNum'), number: _nextPageNum++),
-                );
-              });
-            },
-          ),
-        ],
-      ),
+    return Column(
+      children: <Widget>[
+        Expanded(child: Carousel62209(pages: _pages)),
+        TestButton(
+          child: const Text('ADD PAGE'),
+          onPressed: () {
+            setState(() {
+              _pages.insert(
+                1,
+                Carousel62209Page(key: Key('$_nextPageNum'), number: _nextPageNum++),
+              );
+            });
+          },
+        ),
+      ],
     );
   }
 }
diff --git a/packages/flutter/test/widgets/scroll_position_test.dart b/packages/flutter/test/widgets/scroll_position_test.dart
index 7acd1f1..c7f9a74 100644
--- a/packages/flutter/test/widgets/scroll_position_test.dart
+++ b/packages/flutter/test/widgets/scroll_position_test.dart
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
 import 'package:flutter_test/flutter_test.dart';
 
 ScrollController _controller = ScrollController(initialScrollOffset: 110.0);
@@ -34,16 +34,20 @@
           key: navigatorKey,
           onGenerateRoute: (RouteSettings settings) {
             if (settings.name == '/') {
-              return MaterialPageRoute<void>(
+              return PageRouteBuilder<void>(
                 settings: settings,
-                builder: (_) => const ThePositiveNumbers(from: 0),
                 maintainState: maintainState,
+                pageBuilder: (BuildContext _, Animation<double> _, Animation<double> _) {
+                  return const ThePositiveNumbers(from: 0);
+                },
               );
             } else if (settings.name == '/second') {
-              return MaterialPageRoute<void>(
+              return PageRouteBuilder<void>(
                 settings: settings,
-                builder: (_) => const ThePositiveNumbers(from: 10000),
                 maintainState: maintainState,
+                pageBuilder: (BuildContext _, Animation<double> _, Animation<double> _) {
+                  return const ThePositiveNumbers(from: 10000);
+                },
               );
             }
             return null;
@@ -140,11 +144,14 @@
   ) async {
     var count = 0;
     await tester.pumpWidget(
-      MaterialApp(
-        home: ListView.builder(
-          itemBuilder: (BuildContext context, int index) {
-            return Text('$index', textDirection: TextDirection.ltr);
-          },
+      Directionality(
+        textDirection: TextDirection.ltr,
+        child: SizedBox(
+          child: ListView.builder(
+            itemBuilder: (BuildContext context, int index) {
+              return Text('$index', textDirection: TextDirection.ltr);
+            },
+          ),
         ),
       ),
     );
@@ -178,16 +185,20 @@
     addTearDown(controller.dispose);
 
     await tester.pumpWidget(
-      MaterialApp(
-        home: ListView(
-          controller: controller,
-          children: items.map<Widget>((int item) {
-            return Focus(
-              key: ValueKey<int>(item),
-              focusNode: nodes[item],
-              child: Container(height: 110),
-            );
-          }).toList(),
+      Directionality(
+        textDirection: TextDirection.ltr,
+        child: SizedBox(
+          child: ListView(
+            controller: controller,
+            children: [
+              for (final int item in items)
+                Focus(
+                  key: ValueKey<int>(item),
+                  focusNode: nodes[item],
+                  child: Container(height: 110),
+                ),
+            ],
+          ),
         ),
       ),
     );
@@ -240,15 +251,18 @@
     var buildCount = 0;
     const double height = 500;
     await tester.pumpWidget(
-      MaterialApp(
-        home: ListView.builder(
-          itemBuilder: (BuildContext context, int index) {
-            buildCount += 1;
-            if (Scrollable.recommendDeferredLoadingForContext(context)) {
-              loadedWithDeferral += 1;
-            }
-            return const SizedBox(height: height);
-          },
+      Directionality(
+        textDirection: TextDirection.ltr,
+        child: SizedBox(
+          child: ListView.builder(
+            itemBuilder: (BuildContext context, int index) {
+              buildCount += 1;
+              if (Scrollable.recommendDeferredLoadingForContext(context)) {
+                loadedWithDeferral += 1;
+              }
+              return const SizedBox(height: height);
+            },
+          ),
         ),
       ),
     );
diff --git a/packages/flutter/test/widgets/scrollable_dispose_test.dart b/packages/flutter/test/widgets/scrollable_dispose_test.dart
index 2d8fb8b..36a62dc 100644
--- a/packages/flutter/test/widgets/scrollable_dispose_test.dart
+++ b/packages/flutter/test/widgets/scrollable_dispose_test.dart
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
 import 'package:flutter_test/flutter_test.dart';
 
 import 'test_widgets.dart';
@@ -38,11 +38,12 @@
       final Key outerContainer = GlobalKey();
 
       await tester.pumpWidget(
-        MaterialApp(
-          home: Center(
+        Directionality(
+          textDirection: TextDirection.ltr,
+          child: Center(
             child: Container(
               key: outerContainer,
-              color: Colors.purple,
+              color: const Color(0xFF0000FF),
               width: 400.0,
               child: SingleChildScrollView(
                 scrollDirection: Axis.horizontal,
@@ -52,7 +53,7 @@
                     controller: controller,
                     itemBuilder: (BuildContext context, int index) {
                       return Container(
-                        color: index.isEven ? Colors.red : Colors.green,
+                        color: index.isEven ? const Color(0xFFFF0000) : const Color(0xFF00FF00),
                         height: 200.0,
                         child: Text('Hello $index'),
                       );
@@ -86,7 +87,7 @@
       expect(controller.offset, currentOffset);
 
       // Dispose the scrollables while the finger is still down, this should not crash.
-      await tester.pumpWidget(MaterialApp(home: Container()));
+      await tester.pumpWidget(const SizedBox());
       await tester.pumpAndSettle();
       expect(controller.hasClients, isFalse);
 
diff --git a/packages/flutter/test/widgets/semantics_test.dart b/packages/flutter/test/widgets/semantics_test.dart
index 5e9a55e..e34529b 100644
--- a/packages/flutter/test/widgets/semantics_test.dart
+++ b/packages/flutter/test/widgets/semantics_test.dart
@@ -6,11 +6,12 @@
 import 'dart:ui';
 
 import 'package:flutter/foundation.dart';
-import 'package:flutter/material.dart';
 import 'package:flutter/rendering.dart';
+import 'package:flutter/widgets.dart';
 import 'package:flutter_test/flutter_test.dart';
 
 import 'semantics_tester.dart';
+import 'utils.dart';
 
 void main() {
   setUp(() {
@@ -1880,8 +1881,9 @@
     final key1 = UniqueKey();
     final key2 = UniqueKey();
     await tester.pumpWidget(
-      MaterialApp(
-        home: Semantics(
+      Directionality(
+        textDirection: TextDirection.ltr,
+        child: Semantics(
           blockUserActions: true,
           explicitChildNodes: true,
           child: Column(
@@ -1918,8 +1920,9 @@
   testWidgets('blocking user interaction on a merged child', (WidgetTester tester) async {
     final key = UniqueKey();
     await tester.pumpWidget(
-      MaterialApp(
-        home: Semantics(
+      Directionality(
+        textDirection: TextDirection.ltr,
+        child: Semantics(
           key: key,
           container: true,
           child: Column(
@@ -1952,8 +1955,9 @@
   ) async {
     final key = UniqueKey();
     await tester.pumpWidget(
-      MaterialApp(
-        home: Semantics(
+      Directionality(
+        textDirection: TextDirection.ltr,
+        child: Semantics(
           key: key,
           container: true,
           child: Column(
@@ -2075,20 +2079,18 @@
     final semantics = SemanticsTester(tester);
 
     await tester.pumpWidget(
-      MaterialApp(
-        home: Scaffold(
-          appBar: AppBar(title: const Text('Headings')),
-          body: ListView(
-            children: <Widget>[
-              for (int level = 1; level <= 6; level++)
-                Semantics(
-                  key: ValueKey<String>('heading-$level'),
-                  headingLevel: level,
-                  child: Text('Heading level $level'),
-                ),
-              const Text('This is not a heading'),
-            ],
-          ),
+      Directionality(
+        textDirection: TextDirection.ltr,
+        child: ListView(
+          children: <Widget>[
+            for (int level = 1; level <= 6; level++)
+              Semantics(
+                key: ValueKey<String>('heading-$level'),
+                headingLevel: level,
+                child: Text('Heading level $level'),
+              ),
+            const Text('This is not a heading'),
+          ],
         ),
       ),
     );
@@ -2232,20 +2234,18 @@
     await tester.pumpWidget(
       Directionality(
         textDirection: TextDirection.ltr,
-        child: Scaffold(
-          body: Column(
-            children: <Widget>[
-              Semantics(
-                traversalParentIdentifier: identifier,
-                child: const SizedBox.square(dimension: 10),
-              ),
-              Semantics(
-                traversalChildIdentifier: identifier,
-                child: const SizedBox.square(dimension: 10),
-              ),
-              const SizedBox.square(dimension: 10),
-            ],
-          ),
+        child: Column(
+          children: <Widget>[
+            Semantics(
+              traversalParentIdentifier: identifier,
+              child: const SizedBox.square(dimension: 10),
+            ),
+            Semantics(
+              traversalChildIdentifier: identifier,
+              child: const SizedBox.square(dimension: 10),
+            ),
+            const SizedBox.square(dimension: 10),
+          ],
         ),
       ),
     );
@@ -2308,24 +2308,22 @@
     await tester.pumpWidget(
       Directionality(
         textDirection: TextDirection.ltr,
-        child: Scaffold(
-          body: Column(
-            children: <Widget>[
-              Semantics(
-                traversalParentIdentifier: identifier,
-                child: const SizedBox.square(dimension: 10),
-              ),
-              Semantics(
-                traversalChildIdentifier: identifier,
-                child: const SizedBox.square(dimension: 10),
-              ),
-              Semantics(
-                traversalChildIdentifier: identifier,
-                child: const SizedBox.square(dimension: 10),
-              ),
-              const SizedBox.square(dimension: 10),
-            ],
-          ),
+        child: Column(
+          children: <Widget>[
+            Semantics(
+              traversalParentIdentifier: identifier,
+              child: const SizedBox.square(dimension: 10),
+            ),
+            Semantics(
+              traversalChildIdentifier: identifier,
+              child: const SizedBox.square(dimension: 10),
+            ),
+            Semantics(
+              traversalChildIdentifier: identifier,
+              child: const SizedBox.square(dimension: 10),
+            ),
+            const SizedBox.square(dimension: 10),
+          ],
         ),
       ),
     );
@@ -2391,14 +2389,20 @@
       await tester.pumpWidget(
         Directionality(
           textDirection: TextDirection.ltr,
-          child: Scaffold(
-            body: Column(
+          child: Semantics(
+            container: true,
+            child: Column(
               children: <Widget>[
                 Semantics(
+                  label: 'child_node',
                   traversalChildIdentifier: identifier,
-                  child: TextButton(
+                  child: TestButton(
                     onPressed: () {},
-                    child: Semantics(traversalParentIdentifier: identifier),
+                    child: Semantics(
+                      label: 'parent_node',
+                      traversalParentIdentifier: identifier,
+                      child: const Text('Button Text'),
+                    ),
                   ),
                 ),
                 const SizedBox.square(dimension: 10),
@@ -2413,8 +2417,13 @@
       final error = exception! as FlutterError;
       expect(
         error.message,
-        'The traversalParent 2 cannot be the child of the traversalChild 1 in hit-test order',
+        matches(
+          RegExp(
+            r'The traversalParent \d+ cannot be the child of the traversalChild \d+ in hit-test order',
+          ),
+        ),
       );
+
       semantics.dispose();
     },
     skip: kIsWeb, // [intended] the web traversal order by using ARIA-OWNS.
diff --git a/packages/flutter/test/widgets/shape_decoration_test.dart b/packages/flutter/test/widgets/shape_decoration_test.dart
index 8e08ebb..6021fbe 100644
--- a/packages/flutter/test/widgets/shape_decoration_test.dart
+++ b/packages/flutter/test/widgets/shape_decoration_test.dart
@@ -9,7 +9,7 @@
 import 'dart:typed_data';
 import 'dart:ui' as ui show Image;
 
-import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
 import 'package:flutter_test/flutter_test.dart';
 
 import '../image_data.dart';
@@ -24,10 +24,11 @@
   testWidgets('ShapeDecoration.image', (WidgetTester tester) async {
     addTearDown(imageCache.clear);
     await tester.pumpWidget(
-      MaterialApp(
-        home: DecoratedBox(
+      Directionality(
+        textDirection: TextDirection.ltr,
+        child: DecoratedBox(
           decoration: ShapeDecoration(
-            shape: Border.all(color: Colors.white) + Border.all(),
+            shape: Border.all(color: const Color(0xFFFFFFFF)) + Border.all(),
             image: DecorationImage(image: image),
           ),
         ),
@@ -37,34 +38,32 @@
       find.byType(DecoratedBox),
       paints
         ..drawImageRect(image: rawImage)
-        ..rect(color: Colors.black)
-        ..rect(color: Colors.white),
+        ..rect(color: const Color(0xFF000000))
+        ..rect(color: const Color(0xFFFFFFFF)),
     );
   });
 
   testWidgets('ShapeDecoration.color', (WidgetTester tester) async {
     await tester.pumpWidget(
-      MaterialApp(
-        home: DecoratedBox(
-          decoration: ShapeDecoration(
-            shape: Border.all(color: Colors.white) + Border.all(),
-            color: Colors.blue,
-          ),
+      DecoratedBox(
+        decoration: ShapeDecoration(
+          shape: Border.all(color: const Color(0xFFFFFFFF)) + Border.all(),
+          color: const Color(0xFF0000FF),
         ),
       ),
     );
     expect(
       find.byType(DecoratedBox),
       paints
-        ..rect(color: Color(Colors.blue.value))
-        ..rect(color: Colors.black)
-        ..rect(color: Colors.white),
+        ..rect(color: const Color(0xFF0000FF))
+        ..rect(color: const Color(0xFF000000))
+        ..rect(color: const Color(0xFFFFFFFF)),
     );
   });
 
   test('ShapeDecoration with BorderDirectional', () {
     const decoration = ShapeDecoration(
-      shape: BorderDirectional(start: BorderSide(color: Colors.red, width: 3)),
+      shape: BorderDirectional(start: BorderSide(color: Color(0xFFFF0000), width: 3)),
     );
 
     expect(decoration.padding, isA<EdgeInsetsDirectional>());
@@ -73,9 +72,10 @@
   testWidgets('TestBorder and Directionality - 1', (WidgetTester tester) async {
     final log = <String>[];
     await tester.pumpWidget(
-      MaterialApp(
-        home: DecoratedBox(
-          decoration: ShapeDecoration(shape: TestBorder(log.add), color: Colors.green),
+      Directionality(
+        textDirection: TextDirection.ltr,
+        child: DecoratedBox(
+          decoration: ShapeDecoration(shape: TestBorder(log.add), color: const Color(0xFF00FF00)),
         ),
       ),
     );
@@ -117,7 +117,7 @@
               focal: AlignmentDirectional.bottomCenter,
               focalRadius: 5,
               radius: 2,
-              colors: <Color>[Colors.red, Colors.black],
+              colors: <Color>[Color(0xFFFF0000), Color(0xFF000000)],
               stops: <double>[0.0, 0.4],
             ),
             shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(8.0))),
@@ -163,7 +163,7 @@
             width: 250,
             height: 250,
             decoration: ShapeDecoration(
-              color: Colors.black,
+              color: const Color(0xFF000000),
               shape: CircleBorder(side: BorderSide(color: color, width: 50)),
             ),
           ),
@@ -177,7 +177,7 @@
           width: 800,
           height: 800,
           decoration: const ShapeDecoration(
-            color: Colors.redAccent,
+            color: Color(0xFFFF5252),
             shape: CircleBorder(side: BorderSide(strokeAlign: BorderSide.strokeAlignOutside)),
           ),
           child: Directionality(
@@ -188,13 +188,13 @@
       );
     }
 
-    await tester.pumpWidget(buildWidget(const Color(0xffffffff)));
+    await tester.pumpWidget(buildWidget(const Color(0xFFFFFFFF)));
     await expectLater(
       find.byKey(key),
       matchesGoldenFile('painting.shape_decoration.outlined_border.should_be_white.png'),
     );
 
-    await tester.pumpWidget(buildWidget(const Color(0xfeffffff)));
+    await tester.pumpWidget(buildWidget(const Color(0xFEFFFFFF)));
     await expectLater(
       find.byKey(key),
       matchesGoldenFile('painting.shape_decoration.outlined_border.show_lines_due_to_opacity.png'),
diff --git a/packages/flutter/test/widgets/simple_semantics_test.dart b/packages/flutter/test/widgets/simple_semantics_test.dart
index 29f7400..672f270 100644
--- a/packages/flutter/test/widgets/simple_semantics_test.dart
+++ b/packages/flutter/test/widgets/simple_semantics_test.dart
@@ -2,12 +2,11 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-import 'dart:ui';
-
-import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
 import 'package:flutter_test/flutter_test.dart';
 
 import 'semantics_tester.dart';
+import 'widgets_app_tester.dart';
 
 void main() {
   testWidgets('Simple tree is simple', (WidgetTester tester) async {
@@ -35,12 +34,11 @@
     semantics.dispose();
   });
 
-  testWidgets('Simple tree is simple - material', (WidgetTester tester) async {
+  testWidgets('Simple tree is simple - WidgetsApp', (WidgetTester tester) async {
     final semantics = SemanticsTester(tester);
 
-    // Not using Text widget because of https://github.com/flutter/flutter/issues/12357.
     await tester.pumpWidget(
-      MaterialApp(
+      TestWidgetsApp(
         home: Center(
           child: Semantics(label: 'Hello!', child: const SizedBox(width: 10.0, height: 10.0)),
         ),
@@ -62,17 +60,10 @@
                   children: <TestSemantics>[
                     TestSemantics(
                       id: 3,
-                      rect: const Rect.fromLTWH(0.0, 0.0, 800.0, 600.0),
-                      flags: <SemanticsFlag>[SemanticsFlag.scopesRoute],
-                      children: <TestSemantics>[
-                        TestSemantics(
-                          id: 4,
-                          label: 'Hello!',
-                          textDirection: TextDirection.ltr,
-                          rect: const Rect.fromLTRB(0.0, 0.0, 10.0, 10.0),
-                          transform: Matrix4.translationValues(395.0, 295.0, 0.0),
-                        ),
-                      ],
+                      label: 'Hello!',
+                      textDirection: TextDirection.ltr,
+                      rect: const Rect.fromLTRB(0.0, 0.0, 10.0, 10.0),
+                      transform: Matrix4.translationValues(395.0, 295.0, 0.0),
                     ),
                   ],
                 ),
diff --git a/packages/flutter/test/widgets/sliver_list_test.dart b/packages/flutter/test/widgets/sliver_list_test.dart
index b703a2b..f989802 100644
--- a/packages/flutter/test/widgets/sliver_list_test.dart
+++ b/packages/flutter/test/widgets/sliver_list_test.dart
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
 import 'package:flutter_test/flutter_test.dart';
 
 void main() {
@@ -384,24 +384,20 @@
 }
 
 Widget _buildSliverListRenderWidgetChild(List<String> items, ScrollController controller) {
-  return MaterialApp(
-    home: Directionality(
-      textDirection: TextDirection.ltr,
-      child: Material(
-        child: SizedBox(
-          height: 500,
-          child: CustomScrollView(
-            controller: controller,
-            slivers: <Widget>[
-              SliverList.builder(
-                itemCount: items.length,
-                itemBuilder: (BuildContext context, int index) {
-                  return Chip(key: Key(items[index]), label: Text('Tile ${items[index]}'));
-                },
-              ),
-            ],
+  return Directionality(
+    textDirection: TextDirection.ltr,
+    child: SizedBox(
+      height: 500,
+      child: CustomScrollView(
+        controller: controller,
+        slivers: <Widget>[
+          SliverList.builder(
+            itemCount: items.length,
+            itemBuilder: (BuildContext context, int index) {
+              return SizedBox(key: Key(items[index]), child: Text('Tile ${items[index]}'));
+            },
           ),
-        ),
+        ],
       ),
     ),
   );
diff --git a/packages/flutter/test/widgets/slivers_padding_test.dart b/packages/flutter/test/widgets/slivers_padding_test.dart
index 9522760..e6721de 100644
--- a/packages/flutter/test/widgets/slivers_padding_test.dart
+++ b/packages/flutter/test/widgets/slivers_padding_test.dart
@@ -3,8 +3,8 @@
 // found in the LICENSE file.
 
 import 'package:flutter/gestures.dart';
-import 'package:flutter/material.dart';
 import 'package:flutter/rendering.dart';
+import 'package:flutter/widgets.dart';
 import 'package:flutter_test/flutter_test.dart';
 
 class _MockRenderSliver extends RenderSliver {
@@ -542,7 +542,7 @@
                 padding: const EdgeInsets.only(top: 30),
                 sliver: SliverFillRemaining(
                   hasScrollBody: false,
-                  child: Container(key: key, color: Colors.red),
+                  child: Container(key: key, color: const Color(0xFFFF0000)),
                 ),
               ),
             ],
diff --git a/packages/flutter/test/widgets/syncing_test.dart b/packages/flutter/test/widgets/syncing_test.dart
index 5bf73c0..c42ef71 100644
--- a/packages/flutter/test/widgets/syncing_test.dart
+++ b/packages/flutter/test/widgets/syncing_test.dart
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
 import 'package:flutter_test/flutter_test.dart';
 
 class TestWidget extends StatefulWidget {
@@ -50,9 +50,9 @@
   testWidgets('no change', (WidgetTester tester) async {
     await tester.pumpWidget(
       ColoredBox(
-        color: Colors.blue,
+        color: const Color(0xFF0000FF),
         child: ColoredBox(
-          color: Colors.blue,
+          color: const Color(0xFF0000FF),
           child: TestWidget(persistentState: 1, syncedState: 0, child: Container()),
         ),
       ),
@@ -65,9 +65,9 @@
 
     await tester.pumpWidget(
       ColoredBox(
-        color: Colors.blue,
+        color: const Color(0xFF0000FF),
         child: ColoredBox(
-          color: Colors.blue,
+          color: const Color(0xFF0000FF),
           child: TestWidget(persistentState: 2, syncedState: 0, child: Container()),
         ),
       ),
@@ -82,9 +82,9 @@
   testWidgets('remove one', (WidgetTester tester) async {
     await tester.pumpWidget(
       ColoredBox(
-        color: Colors.blue,
+        color: const Color(0xFF0000FF),
         child: ColoredBox(
-          color: Colors.blue,
+          color: const Color(0xFF0000FF),
           child: TestWidget(persistentState: 10, syncedState: 0, child: Container()),
         ),
       ),
@@ -97,7 +97,7 @@
 
     await tester.pumpWidget(
       ColoredBox(
-        color: Colors.green,
+        color: const Color(0xFF00FF00),
         child: TestWidget(persistentState: 11, syncedState: 0, child: Container()),
       ),
     );
diff --git a/packages/flutter/test/widgets/text_semantics_test.dart b/packages/flutter/test/widgets/text_semantics_test.dart
index a2b784b..3eb1029 100644
--- a/packages/flutter/test/widgets/text_semantics_test.dart
+++ b/packages/flutter/test/widgets/text_semantics_test.dart
@@ -3,11 +3,12 @@
 // found in the LICENSE file.
 
 import 'package:flutter/gestures.dart';
-import 'package:flutter/material.dart';
 import 'package:flutter/rendering.dart';
+import 'package:flutter/widgets.dart';
 import 'package:flutter_test/flutter_test.dart';
 
 import 'semantics_tester.dart';
+import 'widgets_app_tester.dart';
 
 void main() {
   testWidgets('SemanticsNode ids are stable', (WidgetTester tester) async {
@@ -198,9 +199,13 @@
       'THEN the SemanticsNode contains the correct language tag', (WidgetTester tester) async {
     const locale = Locale('de', 'DE');
     const text = 'Flutter 2050';
+
     await tester.pumpWidget(
-      const MaterialApp(
-        home: SelectionArea(child: Text(text, locale: locale)),
+      TestWidgetsApp(
+        home: SelectableRegion(
+          selectionControls: emptyTextSelectionControls,
+          child: const Text(text, locale: locale),
+        ),
       ),
     );
     await tester.pumpAndSettle();