Skip to content

Commit 3f9fa4c

Browse files
authored
Cleanup cross imports (flutter#181807)
Remove material from widgets tests: - reassemble_test.dart - page_storage_test.dart Part of flutter#177415 <!-- Thanks for filing a pull request! Reviewers are typically assigned within a week of filing a request. To learn more about code review, see our documentation on Tree Hygiene: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md --> ## 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 [![talabat.com contributions](https://img.shields.io/badge/talabat.com-contributions-FF5A00?style=flat&logo=flutter&logoColor=white)](https://www.talabat.com) [![Talabat Flutter PRs](https://img.shields.io/badge/Talabat_Flutter_PRs-16%20merged-97ca00?style=flat&logo=flutter&logoColor=white)](https://github.com/search?q=org%3Aflutter+talabat&type=pullrequests)
1 parent 9d58e06 commit 3f9fa4c

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

dev/bots/check_tests_cross_imports.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ class TestsCrossImportChecker {
144144
'packages/flutter/test/widgets/navigator_replacement_test.dart',
145145
'packages/flutter/test/widgets/implicit_animations_test.dart',
146146
'packages/flutter/test/widgets/default_text_editing_shortcuts_test.dart',
147-
'packages/flutter/test/widgets/page_storage_test.dart',
148147
'packages/flutter/test/widgets/sliver_main_axis_group_test.dart',
149148
'packages/flutter/test/widgets/color_filter_test.dart',
150149
'packages/flutter/test/widgets/semantics_merge_test.dart',
@@ -211,7 +210,6 @@ class TestsCrossImportChecker {
211210
'packages/flutter/test/widgets/scroll_activity_test.dart',
212211
'packages/flutter/test/widgets/tap_region_test.dart',
213212
'packages/flutter/test/widgets/lookup_boundary_test.dart',
214-
'packages/flutter/test/widgets/reassemble_test.dart',
215213
'packages/flutter/test/widgets/html_element_view_test.dart',
216214
'packages/flutter/test/widgets/navigator_test.dart',
217215
'packages/flutter/test/widgets/text_semantics_test.dart',

packages/flutter/test/widgets/page_storage_test.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
import 'package:flutter/material.dart';
5+
import 'package:flutter/widgets.dart';
66
import 'package:flutter_test/flutter_test.dart';
77

8+
import 'widgets_app_tester.dart';
9+
810
void main() {
911
testWidgets('PageStorage read and write', (WidgetTester tester) async {
1012
const Key builderKey = PageStorageKey<String>('builderKey');
1113
late StateSetter setState;
1214
var storedValue = 0;
1315

1416
await tester.pumpWidget(
15-
MaterialApp(
17+
TestWidgetsApp(
1618
home: StatefulBuilder(
1719
key: builderKey,
1820
builder: (BuildContext context, StateSetter setter) {
@@ -40,7 +42,7 @@ void main() {
4042
var storedValue = 0;
4143

4244
Widget buildWidthKey(Key key) {
43-
return MaterialApp(
45+
return TestWidgetsApp(
4446
home: StatefulBuilder(
4547
key: key,
4648
builder: (BuildContext context, StateSetter setter) {

packages/flutter/test/widgets/reassemble_test.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
import 'package:flutter/material.dart';
5+
import 'package:flutter/widgets.dart';
66
import 'package:flutter_test/flutter_test.dart';
77

8+
import 'widgets_app_tester.dart';
9+
810
void main() {
911
testWidgets('reassemble does not crash', (WidgetTester tester) async {
10-
await tester.pumpWidget(const MaterialApp(home: Text('Hello World')));
12+
await tester.pumpWidget(const TestWidgetsApp(home: Text('Hello World')));
1113
await tester.pump();
1214
tester.binding.reassembleApplication();
1315
await tester.pump();

0 commit comments

Comments
 (0)