Skip to content

Add itemExtentBuilder support to ListView.separated - #191157

Merged
auto-submit[bot] merged 3 commits into
flutter:masterfrom
Mairramer:add-itemextentbuilder-to-listview-separated
Sep 7, 2026
Merged

auto-submit[bot] merged 3 commits into
flutter:masterfrom
Mairramer:add-itemextentbuilder-to-listview-separated

Conversation

@Mairramer

@Mairramer Mairramer commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

This PR adds itemExtentBuilder support to ListView.separated, allowing optimal scrolling performance when item and separator extents are known.

Closes #138758

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. 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.

@github-actions github-actions Bot added framework flutter/packages/flutter repository. See also f: labels. f: scrolling Viewports, list views, slivers, etc. labels Aug 15, 2026
@Mairramer
Mairramer marked this pull request as ready for review August 27, 2026 11:24

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request exposes itemExtentBuilder in the ListView constructor and adds a test verifying its behavior with ListView.separated. The review feedback suggests adding documentation to clarify that the index passed to itemExtentBuilder in ListView.separated represents the interleaved sliver index (even for items, odd for separators) rather than the semantic item index.

Comment thread packages/flutter/lib/src/widgets/scroll_view.dart
@justinmc
justinmc requested a review from victorsanni September 1, 2026 22:36
@Mairramer Mairramer added the CICD Run CI/CD label Sep 3, 2026
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Sep 3, 2026
@Mairramer Mairramer added CICD Run CI/CD autosubmit Merge PR when tree becomes green via auto submit App labels Sep 3, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Sep 7, 2026
Merged via the queue into flutter:master with commit 5f6e3ed Sep 7, 2026
30 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Sep 7, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Sep 8, 2026
flutter/flutter@63170e9...b444e78

2026-09-08 [email protected] Clean up lint errors in workflows (flutter/flutter#191987)
2026-09-08 [email protected] Remove no-shuffle tag from dropdown_test.dart (flutter/flutter#186398)
2026-09-08 [email protected] Remove no-shuffle from scrollbar test (flutter/flutter#186656)
2026-09-08 [email protected] [tool] Let --local-engine reach the build system again (flutter/flutter#192361)
2026-09-08 [email protected] [flutter_tools] Safely remove web loading indicator on dart-app-ready (flutter/flutter#192233)
2026-09-08 [email protected] [Linux] Don't clear the OpenGL context when a frame has been drawn (flutter/flutter#192137)
2026-09-08 [email protected] ci: update dartdoc from 9.0.6 to 9.0.9 (flutter/flutter#192405)
2026-09-07 [email protected] Add itemExtentBuilder support to ListView.separated (flutter/flutter#191157)
2026-09-07 [email protected] Roll Skia from e1437642d259 to b3fa80a0e168 (5 revisions) (flutter/flutter#192362)
2026-09-07 [email protected] Roll Skia from 2df865d9d369 to e1437642d259 (1 revision) (flutter/flutter#192360)
2026-09-07 [email protected] Roll Skia from c7aa5512d148 to 2df865d9d369 (2 revisions) (flutter/flutter#192357)
2026-09-06 [email protected] Roll Skia from db200e27a634 to c7aa5512d148 (2 revisions) (flutter/flutter#192351)
2026-09-06 [email protected] Roll Fuchsia Linux SDK from _IgixhH4vEgdz9Oqn... to p8hHkUi8uWT9R3N4z... (flutter/flutter#192349)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode 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
victorsanni pushed a commit to victorsanni/packages that referenced this pull request Sep 9, 2026
…r#12791)

flutter/flutter@63170e9...b444e78

2026-09-08 [email protected] Clean up lint errors in workflows (flutter/flutter#191987)
2026-09-08 [email protected] Remove no-shuffle tag from dropdown_test.dart (flutter/flutter#186398)
2026-09-08 [email protected] Remove no-shuffle from scrollbar test (flutter/flutter#186656)
2026-09-08 [email protected] [tool] Let --local-engine reach the build system again (flutter/flutter#192361)
2026-09-08 [email protected] [flutter_tools] Safely remove web loading indicator on dart-app-ready (flutter/flutter#192233)
2026-09-08 [email protected] [Linux] Don't clear the OpenGL context when a frame has been drawn (flutter/flutter#192137)
2026-09-08 [email protected] ci: update dartdoc from 9.0.6 to 9.0.9 (flutter/flutter#192405)
2026-09-07 [email protected] Add itemExtentBuilder support to ListView.separated (flutter/flutter#191157)
2026-09-07 [email protected] Roll Skia from e1437642d259 to b3fa80a0e168 (5 revisions) (flutter/flutter#192362)
2026-09-07 [email protected] Roll Skia from 2df865d9d369 to e1437642d259 (1 revision) (flutter/flutter#192360)
2026-09-07 [email protected] Roll Skia from c7aa5512d148 to 2df865d9d369 (2 revisions) (flutter/flutter#192357)
2026-09-06 [email protected] Roll Skia from db200e27a634 to c7aa5512d148 (2 revisions) (flutter/flutter#192351)
2026-09-06 [email protected] Roll Fuchsia Linux SDK from _IgixhH4vEgdz9Oqn... to p8hHkUi8uWT9R3N4z... (flutter/flutter#192349)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode 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
victorsanni pushed a commit to victorsanni/packages that referenced this pull request Sep 9, 2026
…r#12791)

flutter/flutter@63170e9...b444e78

2026-09-08 [email protected] Clean up lint errors in workflows (flutter/flutter#191987)
2026-09-08 [email protected] Remove no-shuffle tag from dropdown_test.dart (flutter/flutter#186398)
2026-09-08 [email protected] Remove no-shuffle from scrollbar test (flutter/flutter#186656)
2026-09-08 [email protected] [tool] Let --local-engine reach the build system again (flutter/flutter#192361)
2026-09-08 [email protected] [flutter_tools] Safely remove web loading indicator on dart-app-ready (flutter/flutter#192233)
2026-09-08 [email protected] [Linux] Don't clear the OpenGL context when a frame has been drawn (flutter/flutter#192137)
2026-09-08 [email protected] ci: update dartdoc from 9.0.6 to 9.0.9 (flutter/flutter#192405)
2026-09-07 [email protected] Add itemExtentBuilder support to ListView.separated (flutter/flutter#191157)
2026-09-07 [email protected] Roll Skia from e1437642d259 to b3fa80a0e168 (5 revisions) (flutter/flutter#192362)
2026-09-07 [email protected] Roll Skia from 2df865d9d369 to e1437642d259 (1 revision) (flutter/flutter#192360)
2026-09-07 [email protected] Roll Skia from c7aa5512d148 to 2df865d9d369 (2 revisions) (flutter/flutter#192357)
2026-09-06 [email protected] Roll Skia from db200e27a634 to c7aa5512d148 (2 revisions) (flutter/flutter#192351)
2026-09-06 [email protected] Roll Fuchsia Linux SDK from _IgixhH4vEgdz9Oqn... to p8hHkUi8uWT9R3N4z... (flutter/flutter#192349)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add itemExtentBuilder to ListView.separated

2 participants