Repository navigation
Add SliverAppBar showOnScreen semantics test coverage - #190410
auto-submit[bot] merged 2 commits into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request adds a new test verifying that showOnScreen works with a pinned SliverAppBar and a sliver list, and removes a related TODO comment from the scrollable semantics tests. Feedback suggests improving the new test by ensuring robust resource cleanup with addTearDown for the semantics tester, simplifying the widget tree structure using MaterialApp and CustomScrollView, and renaming local constants to follow the lowerCamelCase style guide convention.
| testWidgets('showOnScreen works with pinned SliverAppBar and sliver list', ( | ||
| WidgetTester tester, | ||
| ) async { | ||
| final semantics = SemanticsTester(tester); // enables semantics tree generation | ||
|
|
||
| const kItemHeight = 100.0; | ||
| const kExpandedAppBarHeight = 56.0; | ||
|
|
||
| final containers = List<Widget>.generate( | ||
| 80, | ||
| (int i) => MergeSemantics( | ||
| child: SizedBox(height: kItemHeight, child: Text('container $i')), | ||
| ), | ||
| ); | ||
|
|
||
| final scrollController = ScrollController(initialScrollOffset: kItemHeight / 2); | ||
| addTearDown(scrollController.dispose); | ||
|
|
||
| await tester.pumpWidget( | ||
| Directionality( | ||
| textDirection: TextDirection.ltr, | ||
| child: Localizations( | ||
| locale: const Locale('en', 'us'), | ||
| delegates: const <LocalizationsDelegate<dynamic>>[ | ||
| DefaultWidgetsLocalizations.delegate, | ||
| DefaultMaterialLocalizations.delegate, | ||
| ], | ||
| child: MediaQuery( | ||
| data: const MediaQueryData(), | ||
| child: Scrollable( | ||
| controller: scrollController, | ||
| viewportBuilder: (BuildContext context, ViewportOffset offset) { | ||
| return Viewport( | ||
| offset: offset, | ||
| slivers: <Widget>[ | ||
| const SliverAppBar( | ||
| pinned: true, | ||
| expandedHeight: kExpandedAppBarHeight, | ||
| flexibleSpace: FlexibleSpaceBar(title: Text('App Bar')), | ||
| ), | ||
| SliverList.list(children: containers), | ||
| ], | ||
| ); | ||
| }, | ||
| ), | ||
| ), | ||
| ), | ||
| ), | ||
| ); | ||
|
|
||
| expect(scrollController.offset, kItemHeight / 2); | ||
|
|
||
| final int firstContainerId = tester | ||
| .renderObject(find.byWidget(containers.first)) | ||
| .debugSemantics! | ||
| .id; | ||
| tester.binding.pipelineOwner.semanticsOwner!.performAction( | ||
| firstContainerId, | ||
| SemanticsAction.showOnScreen, | ||
| ); | ||
| await tester.pump(); | ||
| await tester.pump(const Duration(seconds: 5)); | ||
| expect(tester.getTopLeft(find.byWidget(containers.first)).dy, kExpandedAppBarHeight); | ||
|
|
||
| semantics.dispose(); | ||
| }); |
There was a problem hiding this comment.
This test can be simplified and made more robust:
- Robust Resource Cleanup: Use
addTearDown(semantics.dispose)immediately after creatingSemanticsTester. This ensures that the semantics tester is properly disposed of even if an assertion fails during the test, preventing state leakage to subsequent tests. - Simplify Widget Tree: Instead of manually nesting
Directionality,Localizations,MediaQuery,Scrollable, andViewport, useMaterialAppandCustomScrollView. This is much cleaner, more readable, and matches how these widgets are typically used in real applications. - Style Guide Adherence: Local constants should use
lowerCamelCase(e.g.,itemHeightandexpandedAppBarHeight) rather thankCamelCaseper Effective Dart: Style.
testWidgets('showOnScreen works with pinned SliverAppBar and sliver list', (
WidgetTester tester,
) async {
final SemanticsTester semantics = SemanticsTester(tester);
addTearDown(semantics.dispose);
const double itemHeight = 100.0;
const double expandedAppBarHeight = 56.0;
final List<Widget> containers = List<Widget>.generate(
80,
(int i) => MergeSemantics(
child: SizedBox(height: itemHeight, child: Text('container $i')),
),
);
final ScrollController scrollController = ScrollController(initialScrollOffset: itemHeight / 2);
addTearDown(scrollController.dispose);
await tester.pumpWidget(
MaterialApp(
home: CustomScrollView(
controller: scrollController,
slivers: <Widget>[
const SliverAppBar(
pinned: true,
expandedHeight: expandedAppBarHeight,
flexibleSpace: FlexibleSpaceBar(title: Text('App Bar')),
),
SliverList.list(children: containers),
],
),
),
);
expect(scrollController.offset, itemHeight / 2);
final int firstContainerId = tester
.renderObject(find.byWidget(containers.first))
.debugSemantics!
.id;
tester.binding.pipelineOwner.semanticsOwner!.performAction(
firstContainerId,
SemanticsAction.showOnScreen,
);
await tester.pump();
await tester.pump(const Duration(seconds: 5));
expect(tester.getTopLeft(find.byWidget(containers.first)).dy, expandedAppBarHeight);
});References
- Effective Dart: Style recommends using lowerCamelCase for constant names, including local constants. (link)
f645378 to
7ff110d
Compare
|
Closing this in favour of flutter/packages#12341. This PR adds a test under The equivalent test now lives in One leftover: this PR also removed the |
|
An existing Git SHA, To re-trigger presubmits after closing or re-opeing a PR, or pushing a HEAD commit (i.e. with |
|
Re-opened to keep of track of for when contributions open in material_ui. |
| semantics.dispose(); | ||
| }); | ||
|
|
||
| testWidgets('showOnScreen works with pinned SliverAppBar and sliver list', ( |
There was a problem hiding this comment.
I re-opened this, but when this PR does move forward, it will not be adding a test here, but in material_ui.
We'll be able o re-open that other PR soon :)
|
This PR is ready to port to flutter/packages! 🥳 |
|
Done. Trimmed this PR to the framework-only TODO removal, and opened the material_ui test as flutter/packages#12631 |
The widgets test 'showOnScreen works with pinned app bar and sliver list' was switched from SliverAppBar to a SliverPersistentHeader delegate in flutter#186611, which left the Material SliverAppBar path without coverage for SemanticsAction.showOnScreen. Restore that coverage in app_bar_sliver_test.dart and drop the TODO that tracked it. Fixes flutter#189117
Per flutter#188444, restore the SliverAppBar test in flutter/packages instead, since Material is frozen here. This PR now only carries the framework-side TODO removal.
2ee2a7b to
cbc183a
Compare
|
auto label is removed for flutter/flutter/190410, Failed to enqueue flutter/flutter/190410 with HTTP 400: Pull request Required status check "Check Code Freeze" is queued.. |
Roll Flutter from 15d8908addf6 to e8dca90ec9e0 (58 revisions) flutter/flutter@15d8908...e8dca90 2026-08-27 [email protected] Terminate existing process before launching with devicectl (flutter/flutter#191885) 2026-08-27 [email protected] Roll Fuchsia Linux SDK from qjOQi-zAgu_tADorh... to dDxH8G5cDBP602eyG... (flutter/flutter#191889) 2026-08-27 [email protected] [flutter_tools] Verify native assets tree-shaking during linking (flutter/flutter#191637) 2026-08-27 [email protected] Denylists b-series powervr from vulkan (flutter/flutter#191808) 2026-08-27 [email protected] Handle linear and radial gradients in UberSDF (flutter/flutter#190874) 2026-08-27 [email protected] Roll Packages from 740f093 to bd3cbc1 (7 revisions) (flutter/flutter#191886) 2026-08-27 [email protected] Disable more Windows tests that have been causing CI flakes (flutter/flutter#191822) 2026-08-27 [email protected] Roll Skia from d32721369bd8 to 82e972ea84b1 (2 revisions) (flutter/flutter#191880) 2026-08-27 [email protected] Roll Skia from 3640b8edd16c to d32721369bd8 (10 revisions) (flutter/flutter#191858) 2026-08-27 [email protected] Revert: [AGP 9] Update remaining tests to AGP 9 (flutter/flutter#191863) 2026-08-27 [email protected] Roll Fuchsia Test Scripts from 0iCv10IlKfiilEBOU... to 6SXRz6wsA2Zm_rAqP... (flutter/flutter#191852) 2026-08-27 [email protected] Roll pub packages (flutter/flutter#191851) 2026-08-27 [email protected] Refactor FormField build wrappers (flutter/flutter#185795) 2026-08-27 [email protected] Make ScrollPhysics reactive by introducing shouldUpdate (flutter/flutter#189664) 2026-08-27 [email protected] macOS: Fix crash on out-of-bounds text input ranges (flutter/flutter#191780) 2026-08-27 [email protected] Add HCPP feature flag, and turn it on by default in beta/master (flutter/flutter#190623) 2026-08-27 [email protected] [tool] Migrate CleanCommand to modular dependency injection (flutter/flutter#190742) 2026-08-26 [email protected] Update triage docs for ecosystem and codelab changes (flutter/flutter#191809) 2026-08-26 [email protected] [AGP 9] Update remaining tests to AGP 9 (flutter/flutter#191824) 2026-08-26 [email protected] [UIScene] Migrate dev/benchmarks/complex_layout to UIScene lifecycle (flutter/flutter#191619) 2026-08-26 [email protected] Add SliverAppBar showOnScreen semantics test coverage (flutter/flutter#190410) 2026-08-26 [email protected] Add prompt_suggestion icon to list of RTL mirroring icons. (flutter/flutter#191741) 2026-08-26 [email protected] Remove bringup for batch 3 (flutter/flutter#191750) 2026-08-26 [email protected] Roll Skia from b5465d7b0b77 to 3640b8edd16c (6 revisions) (flutter/flutter#191835) 2026-08-26 [email protected] Uiscene migrate custom channels views (flutter/flutter#191817) 2026-08-26 [email protected] Support --[no-]adb-log-filtering CLI option (flutter/flutter#187252) 2026-08-26 [email protected] Roll Dart SDK from cb8a4e1a0fbb to cb4c39d067f3 (2 revisions) (flutter/flutter#191825) 2026-08-26 [email protected] Fix `Navigator.pushNamed<T>()` type checking (flutter/flutter#188148) 2026-08-26 [email protected] Handle the case where a window doesn't have a title set (flutter/flutter#191767) 2026-08-26 [email protected] [Android] Remove old `InputType` constructor from embedding (flutter/flutter#191244) 2026-08-26 [email protected] Roll Skia from 244a6a0f8f92 to b5465d7b0b77 (19 revisions) (flutter/flutter#191810) 2026-08-26 [email protected] Tolerate floating-point rounding in paintImage centerSlice assertion (flutter/flutter#185789) 2026-08-26 [email protected] Fixes translated bounded blurs (flutter/flutter#191615) 2026-08-26 [email protected] Roll Fuchsia Linux SDK from MstTWE1RDOT-RnrtH... to qjOQi-zAgu_tADorh... (flutter/flutter#191769) 2026-08-26 [email protected] Lerp HSVColor and HSLColor hue along the shortest arc (flutter/flutter#191186) 2026-08-26 [email protected] Fix enum instances comparison to use `equality ==` since dart has the correct behavior now (flutter/flutter#191537) 2026-08-26 [email protected] Switches windows to opengles 3 (flutter/flutter#191516) 2026-08-26 [email protected] Roll Dart SDK from 7739e8602bc1 to cb8a4e1a0fbb (1 revision) (flutter/flutter#191784) 2026-08-26 [email protected] iOS,macOS: Check viewType before creating a platform view (flutter/flutter#191777) 2026-08-26 [email protected] Revert: [tool_tests] Remove bringup from Windows tool_tests_commands_2_2 (flutter/flutter#191793) 2026-08-26 [email protected] refactor(flutter_tools): clean up dead unreferenced declarations (flutter/flutter#191163) 2026-08-26 [email protected] Roll Fuchsia GN SDK from a87CbQSWEjkPUK1ZY... to ZsxUUK2SfA-TrNvb8... (flutter/flutter#191763) 2026-08-26 [email protected] [tool_tests] Remove bringup from Windows tool_tests_commands_2_2 (flutter/flutter#191732) 2026-08-25 [email protected] Remove legacy gen_defaults analyze checks (flutter/flutter#191629) 2026-08-25 [email protected] Refactors `try` to avoid `unawaited_return_in_try_block` case (flutter/flutter#191129) 2026-08-25 [email protected] Roll Dart SDK from 8996935d3d0a to 7739e8602bc1 (1 revision) (flutter/flutter#191754) ...
…r#12660) Roll Flutter from 15d8908addf6 to e8dca90ec9e0 (58 revisions) flutter/flutter@15d8908...e8dca90 2026-08-27 [email protected] Terminate existing process before launching with devicectl (flutter/flutter#191885) 2026-08-27 [email protected] Roll Fuchsia Linux SDK from qjOQi-zAgu_tADorh... to dDxH8G5cDBP602eyG... (flutter/flutter#191889) 2026-08-27 [email protected] [flutter_tools] Verify native assets tree-shaking during linking (flutter/flutter#191637) 2026-08-27 [email protected] Denylists b-series powervr from vulkan (flutter/flutter#191808) 2026-08-27 [email protected] Handle linear and radial gradients in UberSDF (flutter/flutter#190874) 2026-08-27 [email protected] Roll Packages from 740f093 to bd3cbc1 (7 revisions) (flutter/flutter#191886) 2026-08-27 [email protected] Disable more Windows tests that have been causing CI flakes (flutter/flutter#191822) 2026-08-27 [email protected] Roll Skia from d32721369bd8 to 82e972ea84b1 (2 revisions) (flutter/flutter#191880) 2026-08-27 [email protected] Roll Skia from 3640b8edd16c to d32721369bd8 (10 revisions) (flutter/flutter#191858) 2026-08-27 [email protected] Revert: [AGP 9] Update remaining tests to AGP 9 (flutter/flutter#191863) 2026-08-27 [email protected] Roll Fuchsia Test Scripts from 0iCv10IlKfiilEBOU... to 6SXRz6wsA2Zm_rAqP... (flutter/flutter#191852) 2026-08-27 [email protected] Roll pub packages (flutter/flutter#191851) 2026-08-27 [email protected] Refactor FormField build wrappers (flutter/flutter#185795) 2026-08-27 [email protected] Make ScrollPhysics reactive by introducing shouldUpdate (flutter/flutter#189664) 2026-08-27 [email protected] macOS: Fix crash on out-of-bounds text input ranges (flutter/flutter#191780) 2026-08-27 [email protected] Add HCPP feature flag, and turn it on by default in beta/master (flutter/flutter#190623) 2026-08-27 [email protected] [tool] Migrate CleanCommand to modular dependency injection (flutter/flutter#190742) 2026-08-26 [email protected] Update triage docs for ecosystem and codelab changes (flutter/flutter#191809) 2026-08-26 [email protected] [AGP 9] Update remaining tests to AGP 9 (flutter/flutter#191824) 2026-08-26 [email protected] [UIScene] Migrate dev/benchmarks/complex_layout to UIScene lifecycle (flutter/flutter#191619) 2026-08-26 [email protected] Add SliverAppBar showOnScreen semantics test coverage (flutter/flutter#190410) 2026-08-26 [email protected] Add prompt_suggestion icon to list of RTL mirroring icons. (flutter/flutter#191741) 2026-08-26 [email protected] Remove bringup for batch 3 (flutter/flutter#191750) 2026-08-26 [email protected] Roll Skia from b5465d7b0b77 to 3640b8edd16c (6 revisions) (flutter/flutter#191835) 2026-08-26 [email protected] Uiscene migrate custom channels views (flutter/flutter#191817) 2026-08-26 [email protected] Support --[no-]adb-log-filtering CLI option (flutter/flutter#187252) 2026-08-26 [email protected] Roll Dart SDK from cb8a4e1a0fbb to cb4c39d067f3 (2 revisions) (flutter/flutter#191825) 2026-08-26 [email protected] Fix `Navigator.pushNamed<T>()` type checking (flutter/flutter#188148) 2026-08-26 [email protected] Handle the case where a window doesn't have a title set (flutter/flutter#191767) 2026-08-26 [email protected] [Android] Remove old `InputType` constructor from embedding (flutter/flutter#191244) 2026-08-26 [email protected] Roll Skia from 244a6a0f8f92 to b5465d7b0b77 (19 revisions) (flutter/flutter#191810) 2026-08-26 [email protected] Tolerate floating-point rounding in paintImage centerSlice assertion (flutter/flutter#185789) 2026-08-26 [email protected] Fixes translated bounded blurs (flutter/flutter#191615) 2026-08-26 [email protected] Roll Fuchsia Linux SDK from MstTWE1RDOT-RnrtH... to qjOQi-zAgu_tADorh... (flutter/flutter#191769) 2026-08-26 [email protected] Lerp HSVColor and HSLColor hue along the shortest arc (flutter/flutter#191186) 2026-08-26 [email protected] Fix enum instances comparison to use `equality ==` since dart has the correct behavior now (flutter/flutter#191537) 2026-08-26 [email protected] Switches windows to opengles 3 (flutter/flutter#191516) 2026-08-26 [email protected] Roll Dart SDK from 7739e8602bc1 to cb8a4e1a0fbb (1 revision) (flutter/flutter#191784) 2026-08-26 [email protected] iOS,macOS: Check viewType before creating a platform view (flutter/flutter#191777) 2026-08-26 [email protected] Revert: [tool_tests] Remove bringup from Windows tool_tests_commands_2_2 (flutter/flutter#191793) 2026-08-26 [email protected] refactor(flutter_tools): clean up dead unreferenced declarations (flutter/flutter#191163) 2026-08-26 [email protected] Roll Fuchsia GN SDK from a87CbQSWEjkPUK1ZY... to ZsxUUK2SfA-TrNvb8... (flutter/flutter#191763) 2026-08-26 [email protected] [tool_tests] Remove bringup from Windows tool_tests_commands_2_2 (flutter/flutter#191732) 2026-08-25 [email protected] Remove legacy gen_defaults analyze checks (flutter/flutter#191629) 2026-08-25 [email protected] Refactors `try` to avoid `unawaited_return_in_try_block` case (flutter/flutter#191129) 2026-08-25 [email protected] Roll Dart SDK from 8996935d3d0a to 7739e8602bc1 (1 revision) (flutter/flutter#191754) ...
…r#12660) Roll Flutter from 15d8908addf6 to e8dca90ec9e0 (58 revisions) flutter/flutter@15d8908...e8dca90 2026-08-27 [email protected] Terminate existing process before launching with devicectl (flutter/flutter#191885) 2026-08-27 [email protected] Roll Fuchsia Linux SDK from qjOQi-zAgu_tADorh... to dDxH8G5cDBP602eyG... (flutter/flutter#191889) 2026-08-27 [email protected] [flutter_tools] Verify native assets tree-shaking during linking (flutter/flutter#191637) 2026-08-27 [email protected] Denylists b-series powervr from vulkan (flutter/flutter#191808) 2026-08-27 [email protected] Handle linear and radial gradients in UberSDF (flutter/flutter#190874) 2026-08-27 [email protected] Roll Packages from 740f093 to bd3cbc1 (7 revisions) (flutter/flutter#191886) 2026-08-27 [email protected] Disable more Windows tests that have been causing CI flakes (flutter/flutter#191822) 2026-08-27 [email protected] Roll Skia from d32721369bd8 to 82e972ea84b1 (2 revisions) (flutter/flutter#191880) 2026-08-27 [email protected] Roll Skia from 3640b8edd16c to d32721369bd8 (10 revisions) (flutter/flutter#191858) 2026-08-27 [email protected] Revert: [AGP 9] Update remaining tests to AGP 9 (flutter/flutter#191863) 2026-08-27 [email protected] Roll Fuchsia Test Scripts from 0iCv10IlKfiilEBOU... to 6SXRz6wsA2Zm_rAqP... (flutter/flutter#191852) 2026-08-27 [email protected] Roll pub packages (flutter/flutter#191851) 2026-08-27 [email protected] Refactor FormField build wrappers (flutter/flutter#185795) 2026-08-27 [email protected] Make ScrollPhysics reactive by introducing shouldUpdate (flutter/flutter#189664) 2026-08-27 [email protected] macOS: Fix crash on out-of-bounds text input ranges (flutter/flutter#191780) 2026-08-27 [email protected] Add HCPP feature flag, and turn it on by default in beta/master (flutter/flutter#190623) 2026-08-27 [email protected] [tool] Migrate CleanCommand to modular dependency injection (flutter/flutter#190742) 2026-08-26 [email protected] Update triage docs for ecosystem and codelab changes (flutter/flutter#191809) 2026-08-26 [email protected] [AGP 9] Update remaining tests to AGP 9 (flutter/flutter#191824) 2026-08-26 [email protected] [UIScene] Migrate dev/benchmarks/complex_layout to UIScene lifecycle (flutter/flutter#191619) 2026-08-26 [email protected] Add SliverAppBar showOnScreen semantics test coverage (flutter/flutter#190410) 2026-08-26 [email protected] Add prompt_suggestion icon to list of RTL mirroring icons. (flutter/flutter#191741) 2026-08-26 [email protected] Remove bringup for batch 3 (flutter/flutter#191750) 2026-08-26 [email protected] Roll Skia from b5465d7b0b77 to 3640b8edd16c (6 revisions) (flutter/flutter#191835) 2026-08-26 [email protected] Uiscene migrate custom channels views (flutter/flutter#191817) 2026-08-26 [email protected] Support --[no-]adb-log-filtering CLI option (flutter/flutter#187252) 2026-08-26 [email protected] Roll Dart SDK from cb8a4e1a0fbb to cb4c39d067f3 (2 revisions) (flutter/flutter#191825) 2026-08-26 [email protected] Fix `Navigator.pushNamed<T>()` type checking (flutter/flutter#188148) 2026-08-26 [email protected] Handle the case where a window doesn't have a title set (flutter/flutter#191767) 2026-08-26 [email protected] [Android] Remove old `InputType` constructor from embedding (flutter/flutter#191244) 2026-08-26 [email protected] Roll Skia from 244a6a0f8f92 to b5465d7b0b77 (19 revisions) (flutter/flutter#191810) 2026-08-26 [email protected] Tolerate floating-point rounding in paintImage centerSlice assertion (flutter/flutter#185789) 2026-08-26 [email protected] Fixes translated bounded blurs (flutter/flutter#191615) 2026-08-26 [email protected] Roll Fuchsia Linux SDK from MstTWE1RDOT-RnrtH... to qjOQi-zAgu_tADorh... (flutter/flutter#191769) 2026-08-26 [email protected] Lerp HSVColor and HSLColor hue along the shortest arc (flutter/flutter#191186) 2026-08-26 [email protected] Fix enum instances comparison to use `equality ==` since dart has the correct behavior now (flutter/flutter#191537) 2026-08-26 [email protected] Switches windows to opengles 3 (flutter/flutter#191516) 2026-08-26 [email protected] Roll Dart SDK from 7739e8602bc1 to cb8a4e1a0fbb (1 revision) (flutter/flutter#191784) 2026-08-26 [email protected] iOS,macOS: Check viewType before creating a platform view (flutter/flutter#191777) 2026-08-26 [email protected] Revert: [tool_tests] Remove bringup from Windows tool_tests_commands_2_2 (flutter/flutter#191793) 2026-08-26 [email protected] refactor(flutter_tools): clean up dead unreferenced declarations (flutter/flutter#191163) 2026-08-26 [email protected] Roll Fuchsia GN SDK from a87CbQSWEjkPUK1ZY... to ZsxUUK2SfA-TrNvb8... (flutter/flutter#191763) 2026-08-26 [email protected] [tool_tests] Remove bringup from Windows tool_tests_commands_2_2 (flutter/flutter#191732) 2026-08-25 [email protected] Remove legacy gen_defaults analyze checks (flutter/flutter#191629) 2026-08-25 [email protected] Refactors `try` to avoid `unawaited_return_in_try_block` case (flutter/flutter#191129) 2026-08-25 [email protected] Roll Dart SDK from 8996935d3d0a to 7739e8602bc1 (1 revision) (flutter/flutter#191754) ...
In #186611 the widgets test
showOnScreen works with pinned app bar and sliver listwas switched fromSliverAppBarto a privateSliverPersistentHeaderdelegate, as part of removing thematerialimport fromscrollable_semantics_test.dart. That was the only test exercisingSemanticsAction.showOnScreenagainst a pinnedSliverAppBar, so the Material path lost coverage and a TODO was left behind to track restoring it.This PR restores the coverage by adding an equivalent test to
packages/flutter/test/material/app_bar_sliver_test.dart, which already imports../widgets/semantics_tester.dartand is where the otherSliverAppBarsemantics tests live. The test performsSemanticsAction.showOnScreenon the first list item and asserts it is revealed below the pinned app bar (dy == expandedHeight) rather than underneath it.I also removed the TODO in
packages/flutter/test/widgets/scrollable_semantics_test.dart, since it points at the issue this PR fixes. Note that the TODO says "in material_ui package" — that package does not exist in the repo yet, so the test is placed in the existing Material test suite (which matches the issue description) and will move along withapp_bar_sliver_test.dartwhen the decoupling work lands. Happy to keep the TODO instead if you'd prefer to track thematerial_uimove separately.Verification:
flutter test packages/flutter/test/material/app_bar_sliver_test.dart— 53 tests pass.flutter test packages/flutter/test/widgets/scrollable_semantics_test.dart— 20 tests pass.pinnedtofalsefails the new test withExpected: <56.0> Actual: <6.0>.Fixes #189117
Pre-launch Checklist
///).