Clean up cross imports in single_child_scroll_view_test.dart, decorated_sliver_test.dart, draggable_scrollable_sheet_test.dart#181613
Conversation
There was a problem hiding this comment.
Code Review
This pull request successfully refactors several widget test files to eliminate cross-imports from the Material library, improving modularity. The changes involve replacing Material-specific widgets and constants with their framework-level equivalents. A test case that was dependent on Material components has been correctly relocated. However, there is a missing import in single_child_scroll_view_test.dart that will cause a compilation error.
9834b6e to
f0ff080
Compare
There was a problem hiding this comment.
Code Review
This pull request removes cross-imports from decorated_sliver_test.dart, draggable_scrollable_sheet_test.dart, and single_child_scroll_view_test.dart. This is achieved by replacing MaterialApp with TestWidgetsApp and Colors constants with their hex values. A test case from single_child_scroll_view_test.dart that depends on Scaffold has been moved to scaffold_test.dart. The corresponding entries in check_tests_cross_imports.dart have been removed. I have one suggestion in decorated_sliver_test.dart to define constants for the new color values to improve readability.
|
Hi @navaronbracke can you resolve the merge conflicts here? Thanks. |
fa1f490 to
62eab53
Compare
| slivers: <Widget>[ | ||
| DecoratedSliver( | ||
| key: key, | ||
| decoration: BoxDecoration(border: Border.all()), |
There was a problem hiding this comment.
@victorsanni This test should not have tested using SliverAppBar. I have adjusted the test accordingly.
| decoration: BoxDecoration(border: Border.all()), | ||
| sliver: const SliverAppBar( | ||
| decoration: BoxDecoration( | ||
| border: Border.all(strokeAlign: BorderSide.strokeAlignCenter), |
There was a problem hiding this comment.
strokeAlignCenter was needed to ensure that the rect for the paint matcher starts at 0,0 for the expectation (otherwise it starts at 0.5,0.5)
| find.byKey(key), | ||
| paints..something((methodName, arguments) { | ||
| if (methodName != #drawRRect) { | ||
| if (methodName != #drawRect) { |
There was a problem hiding this comment.
It is no longer a RRect
| final rect = arguments[0] as Rect; | ||
|
|
||
| // 225.1 is the result of maxExtent (200) + the physics-diminished drag (the 45 pixels from the gesture) | ||
| expect(rect, rectMoreOrLessEquals(const Rect.fromLTRB(0, 0, 300, 225.1), epsilon: 0.03)); |
There was a problem hiding this comment.
The bottom is adjusted for the value in the delegate. I also had to update the epsilon to make the test pass now. (otherwise it fails with ~0.02 difference)
62eab53 to
a9288a3
Compare
a9288a3 to
562ba39
Compare
…t, decorated_sliver_test.dart, draggable_scrollable_sheet_test.dart (flutter/flutter#181613)
…t, decorated_sliver_test.dart, draggable_scrollable_sheet_test.dart (flutter/flutter#181613)
…t, decorated_sliver_test.dart, draggable_scrollable_sheet_test.dart (flutter/flutter#181613)
…t, decorated_sliver_test.dart, draggable_scrollable_sheet_test.dart (flutter/flutter#181613)
…t, decorated_sliver_test.dart, draggable_scrollable_sheet_test.dart (flutter/flutter#181613)
…11060) Manual roll requested by [email protected] flutter/flutter@6e4a481...c023e5b 2026-02-18 [email protected] [web] Pass form validation errors to screen readers via aria-description (flutter/flutter#180556) 2026-02-18 [email protected] Roll Packages from f83926f to 59f905c (10 revisions) (flutter/flutter#182547) 2026-02-18 [email protected] flutter_tools: Copy vendored frameworks from plugin podspecs in ios/macos-framework builds (flutter/flutter#180135) 2026-02-18 [email protected] Marks Windows framework_tests_misc_leak_tracking to be unflaky (flutter/flutter#182534) 2026-02-18 [email protected] Allow TabBar to receive a TabBarScrollController (flutter/flutter#180389) 2026-02-18 [email protected] Clean up cross imports in single_child_scroll_view_test.dart, decorated_sliver_test.dart, draggable_scrollable_sheet_test.dart (flutter/flutter#181613) 2026-02-18 [email protected] Roll Fuchsia Linux SDK from mcN42vw48OPH3JDNm... to Ihau0pUz3u5ajw42u... (flutter/flutter#182530) 2026-02-18 [email protected] Analyzer, require 10.1.0, fix deprecations in dependency_graph.dart (flutter/flutter#182507) 2026-02-17 [email protected] Refactor: Remove material from actions test (flutter/flutter#181702) 2026-02-17 [email protected] [a11y] RangeSlider mouse interaction should change keyboard focus (flutter/flutter#182185) 2026-02-17 [email protected] Remove more getters from userMessages class (flutter/flutter#182166) 2026-02-17 [email protected] Implement getUniformMatX and getUniformMatXArray functionality on web (flutter/flutter#182249) 2026-02-17 [email protected] Do not wait until dispose before removing replaced/popped page (flutter/flutter#182315) 2026-02-17 [email protected] Add contentTextStyle support to SimpleDialog (flutter/flutter#178824) 2026-02-17 [email protected] Filter error messages from `emulator -list-avds` output (flutter/flutter#180802) 2026-02-17 [email protected] [Reland] Cupertino cross imports (flutter/flutter#182416) 2026-02-17 [email protected] Roll Packages from 09104b0 to f83926f (1 revision) (flutter/flutter#182504) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…ed_sliver_test.dart, draggable_scrollable_sheet_test.dart (flutter#181613) This PR cleans up cross imports in - single_child_scroll_view_test.dart - decorated_sliver_test.dart - draggable_scrollable_sheet_test.dart Part of [flutter#177415](flutter#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
…ed_sliver_test.dart, draggable_scrollable_sheet_test.dart (flutter#181613) This PR cleans up cross imports in - single_child_scroll_view_test.dart - decorated_sliver_test.dart - draggable_scrollable_sheet_test.dart Part of [flutter#177415](flutter#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
This PR cleans up cross imports in
Part of #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
///).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. Comments from the
gemini-code-assistbot 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.