refactor: remove material import from scrollable_semantics_test and selectable_region_context_menu_test#186611
Conversation
There was a problem hiding this comment.
Code Review
This pull request removes Material library dependencies from the scrollable_semantics_test.dart and selectable_region_context_menu_test.dart files, replacing MaterialApp with TestWidgetsApp and SliverAppBar with a custom SliverPersistentHeader delegate. It also updates the cross-import checker to reflect these changes. Feedback identifies an inconsistency where a fixed-height delegate is used instead of a collapsing one, which may not fully replicate the original SliverAppBar behavior during scrolling.
| pinned: true, | ||
| expandedHeight: kExpandedAppBarHeight, | ||
| flexibleSpace: FlexibleSpaceBar(title: Text('App Bar')), | ||
| delegate: _PinnedHeaderDelegate(height: kExpandedAppBarHeight), |
There was a problem hiding this comment.
In this test case, the SliverPersistentHeader is initialized with a fixed-height delegate (_PinnedHeaderDelegate(height: kExpandedAppBarHeight)). However, the original SliverAppBar would have collapsed to the default toolbar height (56.0) when scrolled.
To maintain consistency with the original behavior and with the other test case implemented below (line 348), consider using the collapsing constructor here as well. This ensures that if the test involves scrolling, the header behaves as expected.
| delegate: _PinnedHeaderDelegate(height: kExpandedAppBarHeight), | |
| delegate: _PinnedHeaderDelegate.collapsing( | |
| minExtent: _kToolbarHeight, | |
| maxExtent: kExpandedAppBarHeight, | |
| ), |
78c40b9 to
d2c9583
Compare
|
selectable_region_context_menu_test.dart is already covered by #186672, which is approved and intentionally scoped to that file. Could this PR be narrowed to scrollable_semantics_test.dart plus its allowlist entry to avoid duplicate ownership/conflicts? |
|
You are right, thanks for calling this out. I should have checked the existing ownership more carefully before picking up those files. #186623 is already closed, and I am closing #186672 in favor of this PR to avoid keeping duplicate work in the queue. I will do a stricter open-PR check before taking new files going forward. |
|
Thank you @MarlonJD, Normally we keep posting in issue itself when we are picking that issue but since this issue contains multiple files and many people were working on it, we needed this kind of communication. But great job, I will review your another pending PRs. |
|
Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change). If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
Renzo-Olivares
left a comment
There was a problem hiding this comment.
Hi @rkishan516, thank you for the contribution. Had a small comment but mostly looks good to me.
| return Viewport( | ||
| offset: offset, | ||
| slivers: <Widget>[ | ||
| const SliverAppBar( |
There was a problem hiding this comment.
I recommend making a copy of this test in the material library widget tests so we don't lose out on SliverAppBar test coverage here.
There was a problem hiding this comment.
I have added TODO for this, once material is unfrozen for changes, will add this.
There was a problem hiding this comment.
I recommend filing an issue so we don't lose track of this and adding the link to the issue in the TODO.
There was a problem hiding this comment.
Filed #189117 and added the link to the TODO in packages/flutter/test/widgets/scrollable_semantics_test.dart.
1352eaa to
b11b722
Compare
Renzo-Olivares
left a comment
There was a problem hiding this comment.
LGTM w/ one small comment.
3685059 to
9e202e5
Compare
58ec59e to
8a8c133
Compare
…electable_region_context_menu_test
…n control variable
ec1c6bf to
70cc774
Compare
|
Looks like |
flutter/flutter@cf9e8af...846664b 2026-07-14 [email protected] Roll Skia from dfcff99566c3 to 88954ef8f36d (1 revision) (flutter/flutter#189440) 2026-07-14 [email protected] refactor: remove material import from scrollable_semantics_test and selectable_region_context_menu_test (flutter/flutter#186611) 2026-07-14 [email protected] Roll Skia from 3d1fc554f1a2 to dfcff99566c3 (17 revisions) (flutter/flutter#189428) 2026-07-14 [email protected] Roll Dart SDK from 2c587df8f05a to 05bf153370c4 (5 revisions) (flutter/flutter#189426) 2026-07-14 [email protected] [flutter_tools] Remove web hot reload flag (flutter/flutter#185994) 2026-07-14 [email protected] [iOS] Fix flaky keyboard animation test (flutter/flutter#189353) 2026-07-14 [email protected] [Impeller] Playground expanded role (flutter/flutter#188889) 2026-07-14 [email protected] Roll pub packages (flutter/flutter#189409) 2026-07-13 [email protected] Update lock-threads dependency to 6.0.2 (flutter/flutter#189053) 2026-07-13 49699333+dependabot[bot]@users.noreply.github.com Bump actions/labeler from 6.1.0 to 6.2.0 in the all-github-actions group (flutter/flutter#189396) 2026-07-13 [email protected] Remove outdated todo about `analysis bug on Windows` and update condition to also perform `analysis on windows` (flutter/flutter#189283) 2026-07-13 [email protected] Add more 0x0 size tests part 4 (flutter/flutter#185187) 2026-07-13 [email protected] Roll Packages from 20928d5 to ad2eab1 (18 revisions) (flutter/flutter#189387) 2026-07-13 [email protected] [flutter_tools] Fix ADB device listing output parsing regression (flutter/flutter#189369) 2026-07-13 [email protected] Stop running most Mac x64 builders that have Mac ARM equivalents on master (flutter/flutter#189301) 2026-07-13 [email protected] Move a few benchmarks from x64 Intel Macs to ARM (flutter/flutter#189377) 2026-07-13 [email protected] Add note that `hcpp` needs impeller (flutter/flutter#189382) 2026-07-13 [email protected] Roll Fuchsia Linux SDK from vhIlDkWIy21IrlB9E... to oOETA0ISPouDt2xBo... (flutter/flutter#189349) 2026-07-13 [email protected] [flutter_tools] Respect mustMatchAppBuild on Windows native assets (flutter/flutter#186788) 2026-07-13 [email protected] Roll Skia from 8bf65996caba to 3d1fc554f1a2 (2 revisions) (flutter/flutter#189350) 2026-07-13 [email protected] Roll Dart SDK from 0fc1668c4af4 to 2c587df8f05a (9 revisions) (flutter/flutter#189351) 2026-07-13 [email protected] [web] Fall back to full CJK fonts for characters not covered by split slices (flutter/flutter#188890) 2026-07-13 [email protected] Take Mac tool_integration_tests_* out of bringup (flutter/flutter#189368) 2026-07-13 [email protected] [hooks] Roll record_use to 1.0 and unpin (flutter/flutter#189366) 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
This PR remove material import from scrollable_semantics_test and selectable_region_context_menu_test
Part of: #177415
Pre-launch Checklist
///).