137 Commits

Author SHA1 Message Date
Adam Barth
9b9ad3db17 [rename fixit] RouteBuilder -> BuildContext
Fixes #2353
2016-03-12 17:18:31 -08:00
Adam Barth
95fc5ae070 [rename fixit] *Component* -> *Widget*
This patch renames StatelessComponent to StatelessWidget and
StatefulComponent to StatefulWidget.

Fixes #2308
2016-03-12 12:34:05 -08:00
Adam Barth
726eff4953 [rename fixit] *OneChild* -> *SingleChild*
Fixes #1482
2016-03-12 12:33:39 -08:00
Adam Barth
e71bd77e4f [rename fixit] EdgeDims -> EdgeInsets
Fixes #1382
2016-03-12 12:33:38 -08:00
Adam Barth
b5923f9282 [rename fixit] Painter -> RenderObjectPainter
Fixes #774
2016-03-12 11:37:39 -08:00
Adam Barth
e9b8f4450b [rename fixit] scrollDirection -> mainAxis
Fixes #581
2016-03-12 11:35:24 -08:00
Adam Barth
19f615fc2f [rename fixit] MultiChildLayoutDelegate#isChild -> hasChild
Fixes #459
2016-03-12 11:13:10 -08:00
Adam Barth
44c4e930d1 [rename fixit] GestureArena -> GestureArenaManager
Also, change the keys to be explicitly pointer ids.

Fixes #202
2016-03-12 11:13:02 -08:00
Hixie
6795efacab Enable always_specify_types lint
And fix the zillion issues that uncovered.
2016-03-12 00:37:31 -08:00
Ian Hickson
43b0104114 Revert "Merge pull request #2639 from Hixie/always_specify_types"
This reverts commit f41b3411da35929b09009e47cb52474389e42874, reversing
changes made to e33d8d96212f3e337a6660f1eb1118bffc945bf5.

This was a bad check-in due to my mangling uploading a new version of the branch from a different machine.

This reverts https://github.com/flutter/flutter/pull/2639 and will be replaced by https://github.com/flutter/flutter/pull/2640
2016-03-12 00:34:37 -08:00
Hixie
d162d98c79 Enable always_specify_types lint
And fix the zillion issues that uncovered.
2016-03-11 18:27:32 -08:00
Adam Barth
9c08836273 Handle the case of reparenting while updating children
Instead of trying to flush the detached children from the child list, we keep
the set of detached children up to date and query on every read.
2016-03-11 16:34:22 -08:00
Adam Barth
6a54e12240 AspectRatio should attempt to fit its height
If there's not enough height for the given aspect ratio, we now try to see if
using the height to infer the width will fit the given constraints. The
algorithm we use is similar to the one we use for RenderImage.

Fixes #2620
2016-03-11 15:25:06 -08:00
Adam Barth
e59b25b21f Add RotatedBox which applies a rotation before layout
Transform applies its transform before painting, but sometimes you want
the widget to layout after its transform has been applied. We can't
handle general tranforms in this way because we can't couple width and
height constriants, but we can handle certain rotations.

Fixes #1214
2016-03-11 12:23:41 -08:00
Ian Hickson
1b9cd52081 Enable ALL THE LINTS
Well, all the easy ones, anyway.

For some reason `// ignore:` isn't working for me so I've disabled
lints that need that. Also disabled those that require a ton of work
(which I'm doing, but not in this PR, to keep it reviewable).

This adds:
- avoid_init_to_null
- library_names
- package_api_docs
- package_names
- package_prefixed_library_names
- prefer_is_not_empty
- sort_constructors_first
- sort_unnamed_constructors_first
- unnecessary_getters_setters
2016-03-10 23:15:31 -08:00
Ian Hickson
7cf2dbdf37 Fix crash when dumping the app if it uses RichText
Specifically:

* Handle null styles in TextSpan without crashing in toString().

* Handle null children in TextSpan child lists without crashing in
  toString().

* Handle entirely empty TextSpans in toString() explicitly.

* Assert that TextSpans don't contain nulls in various places. This is
  done more often than one might think necessary, because it turns out
  that TextSpan takes a (mutable) List for one of its arguments, so
  who knows what it will contain at any given time. By asserting all
  over the place, hopefully we'll catch it near the change if they do
  change it.

* Add a RichText example to Stocks to exercise RichText and TextSpans.

See also: https://github.com/flutter/flutter/issues/2514, https://github.com/flutter/flutter/issues/2519
2016-03-10 20:48:50 -08:00
Adam Barth
0327141c37 Prepare to make RenderObjectElement buildable
This patch prepares us to pass a BuildContext to RenderObjectWidgets, which
will make it possible to rebuild RenderObjectElements:

 * Delay creation of the render object until mount(). That will let us pass
   `this` to createRenderObject and have the inherited elements be initialized.

 * Cleanup widgets that take builder closures to prepare for their
   RenderObjectElement to be rebuilt more often.

 * Add a test for the interaction between inherited widgets and
   MixedViewport.

Related to #2598
2016-03-10 20:18:37 -08:00
Hixie
c7339de6bc Enable always_declare_return_types lint
And fix a zillion omissions this uncovered.
2016-03-09 17:57:39 -08:00
Hixie
5810cd80bd Avoid 'as' keyword
It has performance implications in release mode.

We'll enable the lint once https://github.com/dart-lang/linter/issues/195 is fixed.
2016-03-09 15:00:55 -08:00
Adam Barth
0d7b0f9ec1 Test harness should check for running Timers and AnimationControllers
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
2016-03-09 13:37:24 -08:00
Hans Muller
efa36de7f0 Merge pull request #2482 from HansMuller/dismiss_action
Support undo in the leave-behind demo
2016-03-08 15:44:50 -08:00
Hans Muller
73d7378cee Support undo in the leave-behind demo 2016-03-08 15:31:29 -08:00
Adam Barth
e8483fb366 Support reparenting state from MultiChildRenderObjectElement
Fixes #2085
2016-03-08 15:21:20 -08:00
Adam Barth
22dc5590c9 Merge pull request #2488 from abarth/custom_sized_by_parent
RenderCustomMultiChildLayoutBox shouldn't be sizedByParent
2016-03-08 12:49:11 -08:00
Adam Barth
cdc2aefc69 ImageFit.cover doesn't respect alignment
We need to apply the alignment to the source rect because the ouput rect fills
the destination rect.

Fixes #1514
2016-03-08 12:39:46 -08:00
Adam Barth
3fb0df878d RenderCustomMultiChildLayoutBox shouldn't be sizedByParent
The getSize function from MultiChildLayoutDelegate might depend on information
other than the incomming constraints.

Fixes #2077
2016-03-08 12:10:00 -08:00
Hans Muller
2662ea5283 Added support for List leave-behind items 2016-03-07 14:50:25 -08:00
Ian Hickson
8a2865ced3 Merge pull request #2249 from Hixie/size-obs-11
SizeObserver crusade: Remove SizeObserver
2016-03-07 10:11:06 -08:00
Ian Hickson
6bef1736c1 Remove the second argument to MultiChildLayoutDelegate.performLayout()
Fixes https://github.com/flutter/flutter/issues/2403

I have an e-mail ready to send to flutter-dev about this.
2016-03-06 12:28:28 -08:00
Adam Barth
688da091dd Flinging continuously should have one scroll start/end pair
Previously we got confused and started sending start/end pairs for each tick of
the fling animation.

Fixes #2430
2016-03-05 19:42:05 -08:00
Adam Barth
fbc0950da4 Factor MojoShell into shell.dart
Putting this code in a separate library let's services that depend only on the
shell be clearer about their dependencies.
2016-03-04 13:48:28 -08:00
krisgiesing
1655ca800a Merge pull request #2405 from krisgiesing/scaling_test
Add tests for AssetVendor and resolution-dependent image loading
2016-03-03 20:48:12 -08:00
Hans Muller
d04ab2e001 BoxDecoration borders define padding 2016-03-03 16:56:27 -08:00
Kris Giesing
fca41bc2c5 Add tests for AssetVendor and resolution-dependent image loading
Fixes #2198
2016-03-03 16:51:42 -08:00
Hans Muller
44cd57f2f2 Add DismissDirection onDismissed() callback parameter 2016-03-03 11:47:15 -08:00
Adam Barth
00a00deffc Add a test for icon opacity crash
Fixes #2361
2016-03-03 10:33:57 -08:00
Adam Barth
59664e4f80 Disable test that's causing bot to hang
This test causes the buildbot to hang. We don't currently have any hang
protection, which means this test ends up killing the bot. Disable the
test for now why we work on the root issues.
2016-03-02 19:29:18 -08:00
Hans Muller
4eae547c87 Fixed tab scrolling 2016-03-02 16:06:40 -08:00
Adam Barth
c51ae28d87 Add "form" parameter to AnimationController forward and reverse
Fixes #2324
2016-03-02 12:05:16 -08:00
Hixie
cb5017d17d Convert LinearGradient and RadialGradient to fractional units
Makes it easier to use without a SizeObserver
2016-03-02 09:56:37 -08:00
Hixie
dfac9f9bd7 SizeObserver crusade: Remove SizeObserver 2016-02-26 18:55:34 -08:00
Hixie
d7bc93b7f0 SizeObserver crusade: The Last Test 2016-02-26 18:49:54 -08:00
Adam Barth
6f7ceff048 Merge pull request #2235 from abarth/animation_status
Elide fewer AnimationStatus callbacks
2016-02-26 16:36:04 -08:00
Adam Barth
25ab5555b7 Elide fewer AnimationStatus callbacks
Previously we would elide forward and reverse callbacks that canceled each
other out, which broke the expected state machine. Now we synchronously deliver
status callbacks when start an animation.

Fixes #1913
2016-02-26 16:29:14 -08:00
Adam Barth
c629006748 Scrollable's callbacks should follow a state machine
Now onScroll callbacks are always bracketed by onScrollStart and onScrollEnd
callbacks.

Fixes #1822
2016-02-26 14:39:50 -08:00
Hixie
f808055756 Remove size observers from scrollables.
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
2016-02-25 10:55:12 -08:00
Adam Barth
4b1a9ff14c Remove PointerRouter and GestureArena arguments
There's no reason to make clients supply a PointerRounter and a
GestureArena when constructing gesture recognizers. These objects are
statics and the gesture recognizers can just grab them directly.

Also, remove the callback constructor arguments. Almost no code used
them. Instead, people seem to prefer using the `..` operator to set
callbacks on the recognizers. Removing the arguments removes a bunch of
boilerplate.
2016-02-24 22:23:00 -08:00
Adam Barth
9d4e0e8551 Merge pull request #2142 from abarth/interactive_text
Add the ability to recognize gestures on text spans
2016-02-24 17:32:30 -08:00
Hixie
512b2e1972 Fix move() to call markNeedsLayout().
Otherwise, changing the order of your children (e.g. shuffling a list of
children) will have no visible effect.
2016-02-24 17:10:59 -08:00
Adam Barth
8e326d724a Add the ability to recognize gestures on text spans
Currently the interface for recognizing gestures on text spans is pretty ugly,
but hopefully we can improve it with time.

Fixes #156
2016-02-24 17:07:35 -08:00