Conversation
There was a problem hiding this comment.
maybe assert > 0, <= 1.0 ?
(would it work with > 1.0?)
There was a problem hiding this comment.
Oh, I see, peek values are absolute pixels. This seems surprising, I would have expected it to be a fraction of the viewportMainAxisExtent.
There was a problem hiding this comment.
I guess it works either way. I don't know what our customers prefer.
There was a problem hiding this comment.
we should test that this handles the main axis extent changing (without rebuilding) when the peek is non-zero.
|
I didn't verify the math, but LGTM. |
There was a problem hiding this comment.
Another way to define this would have been been pageWidth as a percentage of the viewport's width. The default and the maximum would be 1.0.
On a wide screen, like a tablet, you might want to define the pageWidth with a small enough value so that the entire next/prev pages are visible.
There was a problem hiding this comment.
Maybe that's better. I'll give that a try.
There was a problem hiding this comment.
Yeah, that seems cleaner.
There was a problem hiding this comment.
Does this work if peek > viewportDimension / 4, i.e. if 3 or more pages are visible after the pageview has settled?
There was a problem hiding this comment.
I'll add a test for that, but it should work in theory.
There was a problem hiding this comment.
That works. I also tested viewportFractions greater than one.
This feature lets you see a portion of the next and previous page in a PageView. Fixes flutter#8408
This feature lets you see a portion of the next and previous page in a
PageView.
Fixes #8408