This logic is described in the test as looking for a scroll ending
very close to a new page, but in fact its behavior is more like
"very close to a page to the right": if we're not very, very close
to any page, it will pick the page to the left, not an old page.
There's no reason this should be left-right asymmetrical.
Instead, pick the nearest page.
In practice, the case where this makes a difference never arises when
the scroll runs undisturbed to completion; but when the user taps on
the page to hold or drag, the scroll will be interrupted before it
gets within tolerance of a particular page, and this case does arise.
This fixes a glitch that is hard to trigger without time dilation,
but is quite conspicuous with it:
* Open a tab view with at least 4 tabs, e.g. the Buttons screen
of the gallery (with "Animate Slowly" on.)
* Starting at tab 0, tap tab 2.
* When the animation is nearly complete, tap the page a couple
of times, as if to drag it around to scroll. Then let the
page view settle ballistically toward page 2.
* Before it finishes, tap tab 3.
* Suddenly page 1 fills the view, replacing page 2, before we
scroll from there to page 3.
With this fix, the animation in the last step moves smoothly from
where we are when it starts onward to page 3.
* Revert "manual rollback of of 18530 (#18531)"
This reverts commit 3f79f8cba5425e964f05fc79331dc5ff4b82c22f.
* Fix the offset calculation
* Add a unit test
Move the notch computation from the FAB to the BAB.
The notch in the BAB (bottom action bar) for the FAB (floating action button) was previously kept as part of the FAB's implementation. This was done to keep the shape of the FAB and the shape of the notch coupled.
That approach resulted in a somewhat complex and 'non Fluttery' mechanism for propagating the notch computation from the FAB to the BAB.
This CL uncouples the FAB and the notch computation.
With the new API the BAB computes its overall shape including the notch using a NotchedShape delegate.
This includes multiple breaking changes:
* Scaffold.setFloatingActionButtonNotchFor is deleted.
* The ComputeNotch type is deleted.
* The hasNotch property of BottomAppBar is deleted.
* The notchMargin property of FloatingActionButton is deleted.
Quick migration guide from the previous API:
| Previous API | New API |
| ------------------|-------------|
| BottomAppBar(hasNotch: false) | BottomAppBar() |
| Using a FloatingActionButton with: BottomAppBar() / BottomAppBar(hasNotch: true) | BottomAppBar(shape: CircularNotchedRectangle()) |
| Scaffold.setFloatingActionButtonNotchFor(..) | No longer supported |
* Use RenderAnimatedOpacity within AnimatedOpacity widget (#15466)
* Fixed minor bug in RenderAnimatedOpacity
* Updated protected API for ImplicitlyAnimatedWidget
* update tests for TextStyle changes in engine
* roll engine, support Foreground on TextStyle
* roll to TextStyle.foreground
* add tests, update docs, fixes from tests
* add golden tests
* stroke + gradient
* update goldens hash
* Use centered widget
* fix typo
* Disable golden tests until Linux generated files are available
* update goldens
This adds an HSLColor class which uses a perceptual color space based upon human perception of colored light (as opposed to HSV, which is based on pigment colors).
You can see the difference in the color spaces here: https://en.wikipedia.org/wiki/HSL_and_HSV
I also added a "within" matcher for both HSLColor and HSVColor that will check if the (floating point) color components are within a certain error.
And tests.
We have many hidden children because of iOS accessibility (see also #18410).
For example, in the tile screen of complex_layout app, there could be up to 20 children being painted without this PR. With this PR, only 12 get painted.
This should improve the performance of FL-53 by 40%.