This patch aligns the iteration patterns used by animations and
ChangeNotifier. They now both respect re-entrant removal of listeners
and coalesce duplication registrations. (Also, ChangeNotifier
notification is no longer N^2).
Fixes#7533
Previously, these classes where in material.dart, which meant they could
access private interfaces in that library. This patch moves them out
into their own files so that they need to play by the rules of the
public API.
Fixes#5969
It's not correct to set sizedByParent for
RenderCustomSingleChildLayoutBox because the delegate's size function
might depend on information other than the incoming constraints.
Previously the navigator wouldn't always call Route.dispose when it was
removed from the tree. After this patch, the navigator remembers popped
routes so that it can call dispose on them when it is removed from the
tree.
Also, improve some error messages around calling dispose() more than
once on routes and AnimationControllers.
Fixes#7457
The only client of this machinery was AnimationController.fling, but
it's easier for that function to just create the simulation it needs
directly.
Fixes#7216
* MultiTapGestureRecognizer previously would assert if there was no
competition.
* GestureArenaTeam would always select the first recongizer as the
winner even if a later recognizer actually accepted the pointer
sequence.
* debugPrintStack would fail a type check if maxFrames was non-null.
* FractionalOffset.lerp would throw a null-pointer exception if its
second argument was null.
Also, add a number of tests for previously untested lines of code.
The demo of the SimpleDialog had some useful code that should really be part of
the framework. This patch extracts it into a SimpleDialogOption widget.
Remove debugCheckHasScaffold because it is unused.
Also, add tests for InkWell, SimpleDialog, and other widgets.
Previously, the Slider used a drag gesture recognizer to move the head
of the slider, but when the slider was in a vertical scroller, the
recognizer would wait until the user moved the pointer by enough pixels
to disambiguate between sliding the slider and scrolling the scroller.
That worked fine for actual drags, but the slider should also move when
the user taps the track. This patch introduces a tap recognizer to
handle that behavior.
To avoid the slider's drag and tap recognizers from competing with each
other in the arena, this patch introduces the notion of a
GestureArenaTeam, which lets several recognizers combine to form one
entry in the arena. If that entry wins, the team picks the first of its
recognizers as the winner, avoiding latency.
Fixes#7454
Now IconThemeData.fallback is a factory constructor and IconThemeData.of() does
the work of computing the fallback for its clients.
Also, add tests for ImageIcon and ListItems.
Previously we asserted that the element was not in the dirty list, but there
are scenarios where the element can be in the dirty list already. This patch
makes markNeedsBuild handle those cases by simply resorting the dirty list.
Fixes#6119
The indexes passed to paragraph.getBoxesForRange are based on UTF-16 code
units. If the caret is at a character that is encoded as multiple code units,
then the start and end indexes should be adjusted accordingly.
Change `Flexible`'s default `FlexFit`
Previously, `Flexible` defaulted to `FlexFit.tight`, which forced the child to
expand to fill the available space. Now, `Flexible` defaults to
`FlexFit.loose`, which does not force the child to expand to fill the available
space.
If you want the child to expand to fill the available space, consider using
`Expanded` instead.
Fixes#5169
- better documentation
- verify (at run time) that onNotification doesn't return null, and
report copious helpful information if it does.
- add a toString/debugFillDescription convention to Notification.
- actually test Notification
LayoutCallback passes constraints to the callback, but the constraints
object has a different type for different subclasses. This lets you
call invokeLayoutCallback() with a specific type to verify that
everything is working as expected.
Other changes:
Slightly improve the error reporting in RenderObject.
Allow toStringShallow on RenderObject to have its separator configured.
Also, make hasOneLineDescription more discerning.
Also, add a test for hasOneLineDescription.
Also, add a test for GravitySimulation, to test the toString.
- more dartdocs for the drag typedefs
- more toStrings to aid debugging
- require the position for DragUpdateDetails since we were omitting it
in some places
- add the primaryVelocity to DragEndDetails so that consumers don't
have to themselves track the axis in question
- fix the velocity tracker so that it doesn't walk the null data.
Previously, near time t=0 (which pretty much only matters in tests,
but it does matter there) we would walk the velocity data and then
also walk missing data, treating it as Point.zero with t=0.
- simplify some of the velocity tracker; e.g. instead of trying (and
failing?) to clear the velocity tracker when the pointer stalls,
just drop the data before a stall during the velocity estimation
(where we redundantly had another bigger horizon anyway).
Previously, SizeChangedLayoutNotifier fired a notification even for
the first layout.
Also, previously its test relied on that, and didn't actually change
size at all. This fixes the test as well.
Also, rename SizeChangedLayoutNotificaion to SizeChangedLayoutNotification.