Skip to content

Conversation

@jwlilly
Copy link
Contributor

@jwlilly jwlilly commented Aug 25, 2025

Updating AccessibilityBridge.java and AccessibilityBridgeTest.java to include AccessibilityNodeInfo.CollectionItemInfo to get TalkBack to announce item indexes for ListViews.

  • Updated the logic for adding CollectionInfo to add when the scrollChildren count is greater than 1. This is an attempt to exclude something like a SingleChildScrollView from getting CollectionInfo added. The only semantics info we can rely on from Android is the hasImplicitScrolling and the number of scrollChildren.
  • Added logic for adding the CollectionItemInfo to ListView children. It first checks to see if the parent node qualifies for CollectionInfo and then adds the CollectionItemInfo to the child view. The index values come from the childrenInTraversalOrder. We aren't currently passing the indexedSemantics into the SemanticsNode. Once those values are available, this can be made more robust.

The following video includes the new changes with a ListView

list_info_with_a_few_children_screen_recording_20250811_204432.mp4

This video includes the logic with a SingleChildScrollView (no list announcements as expected)

SingleChildScrollView_screen_recording_20250811_204759.mp4

Fixes #168651 - This is a minimal fix. A full fix would be to pass the indexedSemantics to the SemanticsNode in Android and build the list with those values.

Pre-launch Checklist

@github-actions github-actions bot added platform-android Android applications specifically engine flutter/engine related. See also e: labels. team-android Owned by Android platform team labels Aug 25, 2025
@jwlilly jwlilly marked this pull request as ready for review August 25, 2025 18:01
@jwlilly jwlilly requested a review from a team as a code owner August 25, 2025 18:01
@ash2moon ash2moon self-requested a review August 26, 2025 21:05
TestSemanticsUpdate testSemanticsUpdate = parentTestSemanticsNode.toUpdate();
testSemanticsUpdate.sendUpdateToBridge(accessibilityBridge);
AccessibilityNodeInfo nodeInfo = accessibilityBridge.createAccessibilityNodeInfo(1);
assertNotNull(nodeInfo.getCollectionItemInfo());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add a little more testing context on what exactly this collectionItemInfo is supposed to contain?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call! I added additional checks to make sure CollectionInfo and CollectionItemInfo had the correct values which made me find a logic bug that I also fixed.

Fixing logic bug with column/row index
@chinmaygarde
Copy link
Member

This might be ready for another review.

@chinmaygarde
Copy link
Member

At least one of the failures is unrelated and a fix for it is pending in #175794. But there are more failures that look related.

@chinmaygarde
Copy link
Member

The failures look related to the golden images as expected. They'll need to be patched to make forward progress.

@jwlilly
Copy link
Contributor Author

jwlilly commented Sep 22, 2025

The failures look related to the golden images as expected. They'll need to be patched to make forward progress.

Is that something I need to do? Or do I just need to hang out for now?

@chinmaygarde
Copy link
Member

This is good to go. May I add the autosubmit tag?

@jwlilly
Copy link
Contributor Author

jwlilly commented Sep 29, 2025

This is good to go. May I add the autosubmit tag?

Sure, that's fine with me

@chinmaygarde chinmaygarde added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 29, 2025
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Sep 29, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 16, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 16, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Oct 16, 2025
…10244)

Manual roll requested by [email protected]

flutter/flutter@7cd821c...a873a27

2025-10-16 [email protected] [tool] makes listing a shader also as an asset a build failure (flutter/flutter#176866)
2025-10-16 [email protected] Roll Packages from d062181 to 835dccb (7 revisions) (flutter/flutter#177100)
2025-10-16 [email protected] Handle the new location of Perfetto in create_updated_flutter_deps.py (flutter/flutter#177099)
2025-10-16 [email protected] Implement dialog windows for the win32 platform (flutter/flutter#176309)
2025-10-16 [email protected] `SelectableRegion` should not show flutter rendered context menu when web context menu is enabled (flutter/flutter#176855)
2025-10-16 [email protected] Manual roll Skia to 2d9df7c70b6f (flutter/flutter#177074)
2025-10-16 [email protected] feat: add `OptionsViewOpenDirection.mostSpace` to `RawAutocomplete` (flutter/flutter#172997)
2025-10-16 [email protected] [Android] Refactor `ImageReaderSurfaceProducer` restoration after app resumes (flutter/flutter#175937)
2025-10-15 [email protected] Refactor: migrate fade upwards page transition builder to widgets (flutter/flutter#175560)
2025-10-15 [email protected] Marks Windows windowing_test to be unflaky (flutter/flutter#176701)
2025-10-15 [email protected] fix: 🐛 Add equality and hashCode implementations to ScrollAwareImageProvider (flutter/flutter#175038)
2025-10-15 [email protected] Updates `sliver_tree.1.dart‎` to use `MediaQuery.widthOf(context)`  (flutter/flutter#176888)
2025-10-15 [email protected] [web] Fix focus issues in newer versions of Chrome (flutter/flutter#176938)
2025-10-15 [email protected] [Android 16] Update `android_engine_vulkan_tests` to Test Against SDK 36 Emulator (flutter/flutter#176985)
2025-10-15 [email protected] Fix key events interception by RadioGroup when no Radio is focused. (flutter/flutter#176335)
2025-10-15 [email protected] Update cherry-pick instructions to include instructions for pre-release CPs (flutter/flutter#177020)
2025-10-15 [email protected] Manual roll Skia to c501c727a007 (flutter/flutter#177015)
2025-10-15 [email protected] Update examples to latest Linux runner style (flutter/flutter#177033)
2025-10-15 [email protected] [material/menu_anchor.dart] Create internal menu controller if external controller is changed to null. (flutter/flutter#176375)
2025-10-15 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Fix - TalkBack does not announce list information (#174374)" (flutter/flutter#177062)
2025-10-14 [email protected] Implement Regular Windows for Linux (flutter/flutter#176187)
2025-10-14 [email protected] Fix - TalkBack does not announce list information (flutter/flutter#174374)

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
@jwlilly jwlilly restored the Fix---TalkBack-does-not-announce-list-information branch October 27, 2025 22:34
jwlilly added a commit to jwlilly/flutter that referenced this pull request Oct 27, 2025
@jwlilly
Copy link
Contributor Author

jwlilly commented Oct 27, 2025

@ash2moon, @camsim99 I created PR-77622 to fix this issue

jwlilly added a commit to jwlilly/flutter that referenced this pull request Oct 28, 2025
jwlilly added a commit to jwlilly/flutter that referenced this pull request Nov 12, 2025
camsim99 added a commit to jwlilly/flutter that referenced this pull request Nov 17, 2025
jwlilly added a commit to jwlilly/flutter that referenced this pull request Nov 17, 2025
jwlilly added a commit to jwlilly/flutter that referenced this pull request Nov 18, 2025
jwlilly added a commit to jwlilly/flutter that referenced this pull request Nov 20, 2025
jwlilly added a commit to jwlilly/flutter that referenced this pull request Nov 21, 2025
jwlilly added a commit to jwlilly/flutter that referenced this pull request Nov 24, 2025
jwlilly added a commit to jwlilly/flutter that referenced this pull request Dec 1, 2025
jwlilly added a commit to jwlilly/flutter that referenced this pull request Dec 1, 2025
github-merge-queue bot pushed a commit that referenced this pull request Dec 1, 2025
#177622)

Fix for PR #174374. It was reverted due to failing tests for creating
CollectionInfo and CollectionItemInfo using constructors added in API
30. I used the `obtain` method for creating both CollectionInfo and
CollectionItemInfo if the API version is lower than 33. The `obtain`
method was deprecated in API 33.

> 
> Updating AccessibilityBridge.java and AccessibilityBridgeTest.java to
include AccessibilityNodeInfo.CollectionItemInfo to get TalkBack to
announce item indexes for ListViews.
> 
> Updated the logic for adding CollectionInfo to add when the
scrollChildren count is greater than 1. This is an attempt to exclude
something like a SingleChildScrollView from getting CollectionInfo
added. The only semantics info we can rely on from Android is the
hasImplicitScrolling and the number of scrollChildren.
> Added logic for adding the CollectionItemInfo to ListView children. It
first checks to see if the parent node qualifies for CollectionInfo and
then adds the CollectionItemInfo to the child view. The index values
come from the childrenInTraversalOrder. We aren't currently passing the
indexedSemantics into the SemanticsNode. Once those values are
available, this can be made more robust.
> 
> The following video includes the new changes with a ListView
>
>
https://github.com/user-attachments/assets/b9bf1b80-9f29-40e2-8f33-a08919554b7e
> 
> 
> This video includes the logic with a SingleChildScrollView (no list
announcements as expected)
> 
>
https://github.com/user-attachments/assets/8fe4dd24-cc5a-4a6b-b4b0-0f371fea20df

Fixes #168651 - This is a minimal fix. A full fix would be to pass the
indexedSemantics to the SemanticsNode in Android and build the list with
those values but that is a larger effort.

## 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.

---------

Signed-off-by: jwlilly <[email protected]>
Co-authored-by: Reid Baker <[email protected]>
Co-authored-by: Camille Simon <[email protected]>
mboetger pushed a commit to mboetger/flutter that referenced this pull request Dec 2, 2025
…ormation (flutter#177622)

Fix for PR flutter#174374. It was reverted due to failing tests for creating
CollectionInfo and CollectionItemInfo using constructors added in API
30. I used the `obtain` method for creating both CollectionInfo and
CollectionItemInfo if the API version is lower than 33. The `obtain`
method was deprecated in API 33.

> 
> Updating AccessibilityBridge.java and AccessibilityBridgeTest.java to
include AccessibilityNodeInfo.CollectionItemInfo to get TalkBack to
announce item indexes for ListViews.
> 
> Updated the logic for adding CollectionInfo to add when the
scrollChildren count is greater than 1. This is an attempt to exclude
something like a SingleChildScrollView from getting CollectionInfo
added. The only semantics info we can rely on from Android is the
hasImplicitScrolling and the number of scrollChildren.
> Added logic for adding the CollectionItemInfo to ListView children. It
first checks to see if the parent node qualifies for CollectionInfo and
then adds the CollectionItemInfo to the child view. The index values
come from the childrenInTraversalOrder. We aren't currently passing the
indexedSemantics into the SemanticsNode. Once those values are
available, this can be made more robust.
> 
> The following video includes the new changes with a ListView
>
>
https://github.com/user-attachments/assets/b9bf1b80-9f29-40e2-8f33-a08919554b7e
> 
> 
> This video includes the logic with a SingleChildScrollView (no list
announcements as expected)
> 
>
https://github.com/user-attachments/assets/8fe4dd24-cc5a-4a6b-b4b0-0f371fea20df

Fixes flutter#168651 - This is a minimal fix. A full fix would be to pass the
indexedSemantics to the SemanticsNode in Android and build the list with
those values but that is a larger effort.

## 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.

---------

Signed-off-by: jwlilly <[email protected]>
Co-authored-by: Reid Baker <[email protected]>
Co-authored-by: Camille Simon <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request Dec 9, 2025
…r down (#179480)

Fixes regression caused by PR
[#174374](#174374). SliverLists
are not scrolling with TalkBack. Update fixes the issue by adding the
ScrollView or HorizontalScrollView if the scroll actions are present.

Test code used: 

``` dart
import 'package:flutter/material.dart';

void main() => runApp(const MaterialApp(home: MyApp()));

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @OverRide
  Widget build(BuildContext context) {
    return Scaffold(
      body: CustomScrollView(
        slivers: <Widget>[
          const SliverAppBar(
            pinned: true,
            expandedHeight: 100.0,
            title: Text('Pinned Semantic Focus'),
            backgroundColor: Colors.blue,
          ),
          // The List
          SliverList(
            delegate: SliverChildBuilderDelegate((BuildContext context, int index) {
              return ListTile(title: Text('Item $index'), subtitle: const Text('Scroll down then navigate back up'));
            }, childCount: 50),
          ),
        ],
      ),
    );
  }
}

```


https://github.com/user-attachments/assets/a3780f6d-8e22-40b7-83eb-38bc406b8821

- Fixing #179450

## 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.
reidbaker pushed a commit to AbdeMohlbi/flutter that referenced this pull request Dec 10, 2025
Updating AccessibilityBridge.java and AccessibilityBridgeTest.java to
include `AccessibilityNodeInfo.CollectionItemInfo` to get TalkBack to
announce item indexes for ListViews.

- Updated the logic for adding CollectionInfo to add when the
scrollChildren count is greater than 1. This is an attempt to exclude
something like a SingleChildScrollView from getting CollectionInfo
added. The only semantics info we can rely on from Android is the
hasImplicitScrolling and the number of scrollChildren.
- Added logic for adding the CollectionItemInfo to ListView children. It
first checks to see if the parent node qualifies for CollectionInfo and
then adds the CollectionItemInfo to the child view. The index values
come from the `childrenInTraversalOrder`. We aren't currently passing
the indexedSemantics into the SemanticsNode. Once those values are
available, this can be made more robust.

The following video includes the new changes with a ListView


https://github.com/user-attachments/assets/b9bf1b80-9f29-40e2-8f33-a08919554b7e


This video includes the logic with a SingleChildScrollView (no list
announcements as expected)


https://github.com/user-attachments/assets/8fe4dd24-cc5a-4a6b-b4b0-0f371fea20df

Fixes flutter#168651 - This is a minimal fix. A full fix would be to pass the
indexedSemantics to the SemanticsNode in Android and build the list with
those values.

## 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.

<!-- 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

---------

Signed-off-by: jwlilly <[email protected]>
reidbaker pushed a commit to AbdeMohlbi/flutter that referenced this pull request Dec 10, 2025
…74374)" (flutter#177062)

<!-- start_original_pr_link -->
Reverts: flutter#174374
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: chingjun
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: This PR calls the constructor of
`AccessibilityNodeInfo.CollectionInfo`, which is added in API 30,
without the API version guard. It broke some internal tests that are
running on API 29 and below.
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: jwlilly
<!-- end_original_pr_author -->

<!-- start_reviewers -->
Reviewed By: {camsim99, ash2moon}
<!-- end_reviewers -->

<!-- start_revert_body -->
This change reverts the following previous change:
Updating AccessibilityBridge.java and AccessibilityBridgeTest.java to
include `AccessibilityNodeInfo.CollectionItemInfo` to get TalkBack to
announce item indexes for ListViews.

- Updated the logic for adding CollectionInfo to add when the
scrollChildren count is greater than 1. This is an attempt to exclude
something like a SingleChildScrollView from getting CollectionInfo
added. The only semantics info we can rely on from Android is the
hasImplicitScrolling and the number of scrollChildren.
- Added logic for adding the CollectionItemInfo to ListView children. It
first checks to see if the parent node qualifies for CollectionInfo and
then adds the CollectionItemInfo to the child view. The index values
come from the `childrenInTraversalOrder`. We aren't currently passing
the indexedSemantics into the SemanticsNode. Once those values are
available, this can be made more robust.

The following video includes the new changes with a ListView


https://github.com/user-attachments/assets/b9bf1b80-9f29-40e2-8f33-a08919554b7e


This video includes the logic with a SingleChildScrollView (no list
announcements as expected)


https://github.com/user-attachments/assets/8fe4dd24-cc5a-4a6b-b4b0-0f371fea20df

Fixes flutter#168651 - This is a minimal fix. A full fix would be to pass the
indexedSemantics to the SemanticsNode in Android and build the list with
those values.

## 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.

<!-- 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

<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <[email protected]>
reidbaker added a commit to AbdeMohlbi/flutter that referenced this pull request Dec 10, 2025
…ormation (flutter#177622)

Fix for PR flutter#174374. It was reverted due to failing tests for creating
CollectionInfo and CollectionItemInfo using constructors added in API
30. I used the `obtain` method for creating both CollectionInfo and
CollectionItemInfo if the API version is lower than 33. The `obtain`
method was deprecated in API 33.

>
> Updating AccessibilityBridge.java and AccessibilityBridgeTest.java to
include AccessibilityNodeInfo.CollectionItemInfo to get TalkBack to
announce item indexes for ListViews.
>
> Updated the logic for adding CollectionInfo to add when the
scrollChildren count is greater than 1. This is an attempt to exclude
something like a SingleChildScrollView from getting CollectionInfo
added. The only semantics info we can rely on from Android is the
hasImplicitScrolling and the number of scrollChildren.
> Added logic for adding the CollectionItemInfo to ListView children. It
first checks to see if the parent node qualifies for CollectionInfo and
then adds the CollectionItemInfo to the child view. The index values
come from the childrenInTraversalOrder. We aren't currently passing the
indexedSemantics into the SemanticsNode. Once those values are
available, this can be made more robust.
>
> The following video includes the new changes with a ListView
>
>
https://github.com/user-attachments/assets/b9bf1b80-9f29-40e2-8f33-a08919554b7e
>
>
> This video includes the logic with a SingleChildScrollView (no list
announcements as expected)
>
>
https://github.com/user-attachments/assets/8fe4dd24-cc5a-4a6b-b4b0-0f371fea20df

Fixes flutter#168651 - This is a minimal fix. A full fix would be to pass the
indexedSemantics to the SemanticsNode in Android and build the list with
those values but that is a larger effort.

- [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.

---------

Signed-off-by: jwlilly <[email protected]>
Co-authored-by: Reid Baker <[email protected]>
Co-authored-by: Camille Simon <[email protected]>
reidbaker pushed a commit to AbdeMohlbi/flutter that referenced this pull request Dec 10, 2025
…r down (flutter#179480)

Fixes regression caused by PR
[flutter#174374](flutter#174374). SliverLists
are not scrolling with TalkBack. Update fixes the issue by adding the
ScrollView or HorizontalScrollView if the scroll actions are present.

Test code used: 

``` dart
import 'package:flutter/material.dart';

void main() => runApp(const MaterialApp(home: MyApp()));

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @OverRide
  Widget build(BuildContext context) {
    return Scaffold(
      body: CustomScrollView(
        slivers: <Widget>[
          const SliverAppBar(
            pinned: true,
            expandedHeight: 100.0,
            title: Text('Pinned Semantic Focus'),
            backgroundColor: Colors.blue,
          ),
          // The List
          SliverList(
            delegate: SliverChildBuilderDelegate((BuildContext context, int index) {
              return ListTile(title: Text('Item $index'), subtitle: const Text('Scroll down then navigate back up'));
            }, childCount: 50),
          ),
        ],
      ),
    );
  }
}

```


https://github.com/user-attachments/assets/a3780f6d-8e22-40b7-83eb-38bc406b8821

- Fixing flutter#179450

## 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine flutter/engine related. See also e: labels. platform-android Android applications specifically team-android Owned by Android platform team

Projects

None yet

6 participants