...by adding tests to our examples that don't import flutter_test, which
pins the relevant dependencies.
Also, provide more information when complaining about leaked transient
callbacks in tests.
Also, make tests display full information when they have an exception,
by bypassing the throttling we have for Android logging in tests.
Also, make the word wrapping not wrap stack traces if they happen to
be included in exception output.
Also, fix a leaked transient callback in the checkbox code.
- Create a FlutterErrorDetails struct-like class that describes an
exception along with more details that aren't in the exception, like
where it was caught and what was going on when it was caught.
- Provide a FlutterError static API for handling these objects:
- FlutterError.onError which is called whenever Flutter catches an
error.
- FlutterError.reportError() which handles an error.
- FlutterError.dumpErrorToConsole() which is the default behavior
for onError.
- Removes all the existing exception handler callbacks.
- Replaces all the existing places that described exceptions using
debugPrint with calls to FlutterError.reportError().
- Extend lockState() to also catch exceptions, so that we catch
exceptions that happen during finalizers.
- Make the test framework catch errors and treat them as failures.
- Provide a mechanism to override this behavior in the test framework.
- Make the tests that used to depend on the exception handler
callbacks use this new mechanism.
- Make pump() also support the phase argument.
- Improve some tests using these new features.
Fixes#2356, #2988, #2985, #2220.
Adds BuildOwner to manage the dirty list and build processing for
widgets/elements, and adds a widget unit test to make sure separation
is enforced.
Fixes#2723
After running a widget test, we now clear out the widget tree and check that we
didn't leak any timers or animations.
Also, fix several bugs that this addtional check revealed.
Fixes#2481
Also:
- add operator==/hashCode/toString to ViewportDimensions
- add toString to BindingBase
- add toString and debugFillDescription to ScrollBehavior
- fix a bug in the RawGestureDetectorState's replaceGestureRecognizers
- rename MixedViewport's onExtentsUpdate to onExtentChanged
- replace ExtentsUpdateCallback with ValueChanged<double>
- remove a microtask for dispatching scroll start, since it
did not appear to have any purpose
- added dartdocs to Instrumentation until I understood it
- made all event dispatch in Instrumentation drain microtasks
Each layer is supposed to reexport the parts of the previous layer
that are part of its API.
- In painting.dart, export from dart:ui all the Canvas-related APIs
that make sense to be used at higher levels, e.g. PaintingStyle.
- Delete painting/shadows.dart. It was dead code.
- In rendering/object.dart, export all of painting.dart.
- In widgets/basic.dart, export all of painting.dart and
animation.dart. Some classes in animation/ are renamed to make this
less disruptive and confusing to the namespace.
- Split out Stocks back into an import model rather than a part model,
so that it's easier to manage its dependencies on a per-file basis.
- Move Ticker to scheduler library.
- Remove as many redundant imports as possible now.
- Some minor nit picking cleanup in various files.
I had to add a setLocale method to WidgetTester and
split the code in FlutterBinding which handled locale
changes to allow me to dispatch a locale change w/o actually
changing what the c++ code reports as the locale.
Also added the test to Travis.
@abarth @jason-simmons
Instead of PointerInputEvent having a "type" field, we now have a
different class for each pointer type.
This has ripple effects throughout the system.
I also did code cleanup in affected files while I was there.
Also:
- minor code reindents in places.
- reset the widget tree between tests.
- once you generate a route, don't let its builder change
(previously it would keep changing as the routes table changed).
- revert the stocks app toolbar-fading-on-forward-transition thing.
The names are probably less familiar, but more consistent:
- FrameCallback: a callback that is relative to the frame and wants the
frame offset (a duration) as argument.
- addXFrameCallback: adds the given callback to the internal lists/maps.
- scheduleXFrameCallback (currently only X = ""): add the callback, but
also trigger a new frame.
- handleX: the method that is invoked when the event-loop or the frame
calls into the scheduler.
- ensureXYZ: ensure that the callback happens.
Unfortunately there is the ambiguity between a "callback": it can be a
closure, or the action of doing a callback, so we end up with:
ensureBeginFrameCallback, and ensureEventLoopCallback, where
"callback" means the action of being called back.
We use a number of non-public APIs in the test package, which makes our
dependency quite fragile. This patch pins a specific, known-good version. We
should update to the lastest version in a follow-up patch.