622 Commits

Author SHA1 Message Date
Adam Barth
865e3cc0ce Update engine
This change brings in a new version of Mojo, which has improved Mozart
interfaces.
2016-03-02 18:32:49 -08:00
Adam Barth
7a2d82d0af Merge pull request #2301 from abarth/dotdot_pattern
updateRenderObject() methods should use the .. pattern
2016-03-01 14:39:11 -08:00
Ian Hickson
2c78c06136 Fix dump debugging tools 2016-03-01 13:59:58 -08:00
Adam Barth
ac1cba59ca updateRenderObject() methods should use the .. pattern
Fixes #1381
2016-03-01 13:03:29 -08:00
Adam Barth
96246c1a04 Improve the error message when calling setState during build
Now we produce an error message that explains why this operation isn't
permitted by the framework.

Fixes #1925
2016-03-01 11:08:19 -08:00
Hixie
ff8d60c8dd Point Stack users to CustomMultiChildLayout. 2016-02-29 14:28:20 -08:00
Hixie
438f209088 SizeObserver crusade: ScrollableMixedWidgetListState 2016-02-26 18:40:05 -08:00
Hixie
157ac75248 SizeObserver crusade: Mimcable 2016-02-26 16:48:46 -08:00
Adam Barth
fc564f0c44 Merge pull request #2238 from abarth/rm_animation_direction
Remove AnimationDirection
2016-02-26 16:46:53 -08:00
Ian Hickson
d998edd366 Merge pull request #2236 from Hixie/raw-gesture-detector-assert
Fix crash in Block.
2016-02-26 16:41:15 -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
3bbeee7b54 Remove AnimationDirection
This concept is now private to AnimationController. All the clients actually
want the AnimationStatus.
2016-02-26 16:32:42 -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
Hixie
fcb3071936 Fix crash in Block.
This assert was overzealous. You can update a RawGestureDetector any
time before the semantics phase, it doesn't have to only be during your
child's layout.

This is good because Block has additional PointerListeners between its
GestureDetector and its Viewport.
2016-02-26 15:56:40 -08:00
Ian Hickson
13b8777f89 Merge pull request #2230 from Hixie/size-obs-7
SizeObserver crusade: Heroes
2016-02-26 15:47:39 -08:00
Adam Barth
6ecbd548c4 Merge pull request #2227 from abarth/scroll_events
Scrollable's callbacks should follow a state machine
2016-02-26 14:47:53 -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
8f2ef23736 SizeObserver crusade: Heroes
Somehow this actually made heroes way simpler.
2016-02-26 13:56:55 -08:00
Hixie
f7d493b65b SizeObserver crusade: Remove EnterExitTransition
...and friends.
2016-02-26 12:55:52 -08:00
Hixie
be865e1e1a SizeObserver crusade: RawInputLine 2016-02-26 10:17:47 -08:00
Hixie
a78d2c9e8b SizeObserver crusade: Dismissable
Refactor Dismissable to not need a SizeObserver and to generally tighten
up the code a bit.
2016-02-25 14:02:49 -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
Hixie
0df3730d3e Just-in-time mutations of GestureDetector
This allows us to adjust exactly which gestures we're listening for
during layout, which I'll use to kill a SizeObserver.
2016-02-24 16:18:05 -08:00
Adam Barth
fb4dbf4584 Improve TextSpan
Now we just have one TextSpan class that handles both simple strings, trees of
children, and styling both. This approach simplifies the interface for most
clients.

This patch also removes StyledText, which was weakly typed and tricky to use
correctly. The replacement is RichText, which is strongly typed and uses
TextSpan.
2016-02-24 14:07:10 -08:00
Hixie
98d47c3544 Clean up scroll behaviour.
This makes ScrollBehavior agnostic about the kind of scroll.
This also means ExtentScrollBehavior's comment about being linear is
more relevant (previously it was true of all scroll behaviours).
2016-02-23 11:56:37 -08:00
Hans Muller
8cfe31f5e8 Added GridTileBar, grid gallery demo 2016-02-18 10:13:36 -08:00
Hans Muller
ba3930cc88 Changed grid layout padding and inter row/column spacing 2016-02-16 16:51:27 -08:00
Adam Barth
6a9de1d735 Add docs for RepaintBoundary 2016-02-16 13:41:44 -08:00
Adam Barth
302640a391 Improve the sample code for createState
The previous sample code isn't a common (or recommended) pattern.
2016-02-16 11:09:23 -08:00
Adam Barth
4408c820e1 Rename AutoLayoutParams to AutoLayoutRect
This object represents a rect the auto-layout system.
2016-02-15 16:29:27 -08:00
Adam Barth
c7d71d8ab1 Simplify the AutoLayout API
This patch makes it easier to use the auto layout API:

* We no longer use operator== because that requires an ugly cast by the
  API user.
* Also, "leftEdge" is now just "left" for less verbosity.
* AutoLayoutChild not implies its key from the AutoLayoutParam object.
* We now correctly layout every child of a RenderAutoLayout object even
  if the solver doesn't flush any updates to that child.
2016-02-15 15:25:21 -08:00
Adam Barth
262dd7a63b Add support for autolayout to widgets
This patch teaches the widget framework how to use Cassowary-based
autolayout. To integrate autolayout with widgets, I had to refactor how
RenderAutoLayout worked a bit. Now RenderAutoLayout follows the same
delegate pattern we use for custom paint and custom layout.
2016-02-15 03:01:40 -08:00
Adam Barth
4fb47600e4 Add a Velocity class to be explicit about units
We were using an Offset, which represented pixels/second, but it wasn't
clear to clients whether that was pixels/ms. Now we use a Velocity class
that is explict about the units.

Fixes #1510
Fixes #785
2016-02-13 22:59:09 -08:00
Ian Hickson
f54b8ad510 Use Image.toString instead of rolling our own each time
I meant to check this in as part of https://github.com/flutter/flutter/pull/1852
but forgot to commit the local change, d'oh.
2016-02-13 17:54:10 -08:00
Ian Hickson
3eb1b412e0 Fix color of icons in drawers in dark theme.
This makes it match the material spec more.
https://www.google.com/design/spec/style/icons.html

Fixes https://github.com/flutter/flutter/issues/1357
2016-02-13 17:10:10 -08:00
Hixie
19a2f5ef74 Horizontal and Vertical Draggables 2016-02-12 17:16:39 -08:00
Hixie
334fcbbf44 Draggables were disappearing
I forgot to wrap the state changing in a setState. Oops.
2016-02-12 14:03:47 -08:00
Adam Barth
baca514f99 Merge pull request #1827 from abarth/scrollable_list_padding
Fix padding for ScrollableList
2016-02-12 13:59:59 -08:00
Adam Barth
ad2fa5a6e7 Fix padding for ScrollableList
Previously we had totally wrong behavior. Now we have more correct behavior and
testing.

Fixes #1808
2016-02-12 13:39:05 -08:00
Hixie
fd7be69df0 SizeObserver crusade: snap alignment
Remove the SizeObserver you need to use snap alignment in lists by
having the lists provide the size themselves in the callback.

Also, remove snapAlignmentOffset since we couldn't figure out how to
explain it and it's not really needed.
2016-02-12 12:40:44 -08:00
Hixie
0d1a3cfcff Assert that custom painters balance save/restores. 2016-02-12 08:35:45 -08:00
Jason Simmons
279c6149c5 Merge pull request #1747 from jason-simmons/input_field_clear
Change the text/selection value API of the input field
2016-02-11 13:46:13 -08:00
Hixie
8e279f320e Provide a Draggable that starts on drag
This lets it cooperate with other gestures like tap.

The way I implemented this was to refactor the entire Draggable gesture
logic to use a new kind of gesture detector called
MultiDragGestureRecognizer. It works a bit like
MultiTapGestureRecognizer but for drags.

Also some tweaks to the velocity estimator.
2016-02-11 12:54:10 -08:00
Jason Simmons
52c55344d9 Change the text/selection value API of the input field
(see https://github.com/flutter/flutter/issues/1586)
2016-02-11 12:52:15 -08:00
Ian Hickson
a94999ba50 Clean up imports and exports.
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.
2016-02-11 00:06:23 -08:00
Adam Barth
fc23277df5 Cleanup MixedViewport
This patch fixes a couple minor bugs and cleans up MixedViewport a bit.
2016-02-10 23:24:28 -08:00
Adam Barth
40151689f1 ScrollableList was applying padding twice
We need to subtract the padding instead of adding it.
2016-02-10 15:51:25 -08:00
Adam Barth
ec9ab32435 ScrollBehavior should support negative min scroll offset
Fixes #1730
2016-02-10 12:13:20 -08:00
Adam Barth
4ba5e712bc Teach PageableList about scroll anchors 2016-02-10 10:34:59 -08:00