Implicit scrolling for pageview#45598
Conversation
| /// scrolling. | ||
| /// | ||
| /// With this flag set to false, when accessibility focus reaches the end of | ||
| /// the current page and a user performs another implicit scroll action, |
There was a problem hiding this comment.
the "implicit scroll action" is moving a11y focus to the next element. Maybe we should say:
With this flag set to false, when accessibility focus reaches the end of current page and the user attempts to move it to the next element, the focus will traverse to the next widget outside of the page view.
With this flag set to true, when accessibility focus reaches the end of the current page and user attempts to move it to the next element, focus will traverse to the next page in the page view.
There was a problem hiding this comment.
I like that better, thanks - done.
| viewportBuilder: (BuildContext context, ViewportOffset position) { | ||
| return Viewport( | ||
| cacheExtent: 0.0, | ||
| cacheExtent: widget.allowImplicitScrolling ? 1.0 : 0.0, |
There was a problem hiding this comment.
Maybe leave a TODO here to make the cacheExtend/cacheExtendStyle configurable on the pageView once we have implicitScrolling set up correctly on iOS.
|
The commit behind this one is about to be reverted while I investigate perf regression that started with it. Will have to put this on hold. |
|
Regression was unrelated, code is safe for now |
Description
Previous attempt here: #44645
This is an improvement on that (I hope) in terms of documentation and implmentation. No longer uses a layout builder.
If we can get the iOS bridge to respect the
allowImplicitScrollingflag, we could also allow for the page view to have a non-zero cache extent - but for now, on iOS, having a cache extent allows implicit a11y scrolling.Basic use case here is to use a PageView in non-full-screen applications such as a carousel.
Related Issues
#44645
fixes #44484
Tests
I added the following tests:
Test asserting the semantics tree looking right when the new flag is set.
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Does your PR require Flutter developers to manually update their apps to accommodate your change?