Commit Graph

259 Commits

Author SHA1 Message Date
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
abce29f118 Merge pull request #1774 from Hixie/exports
Clean up imports and exports.
2016-02-11 00:12:42 -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
f4d784dca9 Add an example of creating a custom RenderBox 2016-02-11 00:04:14 -08:00
Hixie
c56d378868 Draggable: childWhenDragging, maxSimultaneousDrags 2016-02-09 14:47:53 -08:00
Adam Barth
657eadcdb5 Make the Mozart demo more like a real window manager
We now have a resizer and close button. Also add some shadows and
launcher buttons.
2016-02-08 21:08:12 -08:00
Adam Barth
256af1433c Actually populate the view host proxy
Now that the engine lets us take the view host handle, we can actually
access the view host from Dart.
2016-02-08 15:14:09 -08:00
Hans Muller
82e4309960 Support a TabLabel icon Widget builder. 2016-02-05 09:43:17 -08:00
Hans Muller
6bc65e0373 Add support for the appbar behavior described in the "Flexible space with image" section of https://www.google.com/design/spec/patterns/scrolling-techniques.html#scrolling-techniques-scrolling. 2016-02-02 16:32:39 -08:00
Kris Giesing
9572b4969f Add support for asset variants and resolution-aware images 2016-01-28 18:11:32 -08:00
Adam Barth
92e0092cae Merge pull request #1412 from abarth/fix_container
examples/widgets/container.dart does not display the buttons
2016-01-27 11:27:46 -08:00
Adam Barth
4aac34019c examples/widgets/container.dart does not display the buttons
Add a missing Material.

Fixes #1402
2016-01-27 10:59:24 -08:00
Hixie
a309cea1d4 Resurrect spinning_mixed.
It had bit-rotted. Also improve our error reporting for missing Material.
2016-01-27 10:07:11 -08:00
Collin Jackson
d48a469f8a Merge pull request #1389 from collinjackson/contentType
Example of setting the content type of a POST request
2016-01-26 13:05:16 -08:00
Collin Jackson
cd95d51c70 Example of setting the content type of a POST request 2016-01-26 12:24:33 -08:00
Adam Barth
58c7fdef36 Add RawKeyboardListener
RawKeyboardListener makes it easier to listen for raw keyboard events.

Fixes #787
2016-01-25 20:37:22 -08:00
Hans Muller
8218ff683f Change Block children to be a named parameter 2016-01-22 08:04:21 -08:00
Adam Barth
b988a875ad Remove Performance and AnimatedValue
This patch removes Performance and AnimationValue now that we've ported the
framework over to AnimationController and Tween. This patch also cleans up the
names of the AnimationController classes now that they don't have to avoid
conflicts with the old animation API. Specifically, I've made the following
renames:

 * Animated -> Animation
 * Evaluatable -> Animatable
 * PerformanceStatus -> AnimationStatus

This patch is just renames and moving code around. There aren't any changes in
behavior.
2016-01-20 13:49:35 -08:00
Adam Barth
d25951c517 AnimatedBuilder should have a child
Providing a pre-built child is more efficient because we don't need to rebuild
the child every tick of the animation.
2016-01-20 09:10:34 -08:00
Adam Barth
0b098ee2e5 Move Scaffold over to using AnimationController
Also, clean up the class hierarchy for AnimationController now that
we've renamed progress to value. That means everything in the hierarchy
now has a value, include Watchable. This patch renames Watchable to
Animated<T>, which lets us use that type almost everywhere.

I've added some ducktape to modal bottom sheets to avoid having to
refactor all of Navigator to use AnimationController. I'll remove the
ducktape in the next patch.
2016-01-20 08:43:04 -08:00
Hans Muller
3f0cca02cb Revised Material Gallery demo 2016-01-19 17:02:32 -08:00
Adam Barth
fc978c1aa8 Port examples to the new animation API
These now use Animation and AnimationController instead of PerformanceView and
Performance.
2016-01-19 16:03:31 -08:00
Adam Barth
bc20871cb9 Introduce Tween and the new animation API
This patch removes state from the animation system, which was causing problems
as we were scaling the use of animated values.

Now the "tween" objects are stateless and can watch animations, which creates a
new object that holds both the tween and the animation instead of mutating the
tween every tick of the animation.

This patch ports one client as a proof-of-concept.

Fixes #215
2016-01-19 14:26:05 -08:00
Hans Muller
179ca8164e Upgrade progress_indicator demo defend against null color in updateTaskDescription 2016-01-15 08:41:57 -08:00
Hans Muller
cafea7f51f Floating Action Button transitions 2016-01-12 11:42:20 -08:00
Ian Hickson
867bbcc9bd Provide a safe time to update a WidgetToRenderBoxAdapter
If you change the RenderObject tree between frames, you'll assert if
you subsequently hit test. So e.g. if you get two button presses back
to back, and you mutate the tree synchronously in response to the
first one, the second will assert.

This adds an onBuild callback to WidgetToRenderBoxAdapter to make it
easier to do the updates at the right time, i.e., during widget build.
It'll be called whenever you rebuild the WidgetToRenderBoxAdapter
itself, so all you have to do to use it is call setState() on whoever
is building the WidgetToRenderBoxAdapter.
2016-01-11 23:14:37 -08:00
Adam Barth
82bb3bd40d ShaderMask needs to play nicely with compositing
This patch adds ShaderLayer and makes ShaderMask use it.

Fixes #1155
2016-01-11 21:57:54 -08:00
Alex Fandrianto
9bf16fbd6a Also update piano.dart 2016-01-11 18:53:32 -08:00
Adam Barth
056766414c Use a named argument for Widget children
Previously we used a positional argument for widgets that had multiple
children. Now we use a named argument that defaults to an empty list.

Fixes #241
2016-01-11 13:17:09 -08:00
Adam Barth
b2cef9f2b2 Rename ScrollDirection to Axis
We use the ScrollDirection for more than just scrolling.

Fixes #151
2016-01-11 11:28:42 -08:00
Adam Barth
e64d93a520 Switch PageableList over to using RenderList
This patch moves PageableList off HomogeneousViewport and onto RenderList and
friends, making it match the new ScrollableList.
2016-01-06 15:28:01 -08:00
Adam Barth
627c1ffb5c Replace ScrollableList with ScrollableList2
ScrollableList2 is complete and subsumes all the use cases for the original
ScrollableList.
2016-01-06 11:16:57 -08:00
Adam Barth
b1f9138f52 Switch clients of ScrollableList to ScrollableList2
This patch also changed ScrollableList2 to use an Iterable instead of an
List for its children. This change lets clients map their underlying
data lazily. If the clients actually have a concrete list, we skip the
extra copy and grab the child list directly.
2016-01-05 16:21:00 -08:00
Adam Barth
99bca282c9 Introduce ScrollableList2
ScrollableList2 uses the same pattern as ScrollableGrid, which requires the
client to allocate widgets for every list item but doesn't inflate them unless
they're actually needed for the view. It improves on the original
ScrollableList by not requiring a rebuild of the whole visible portion of the
list when scrolling. In fact, small scrolls can often be handled entirely by
repainting.
2016-01-04 16:34:39 -08:00
Adam Barth
6106fa9d6d Add support for scrollable grids
We now support (vertically) scrollable grids with viewporting. If the
scroll doesn't reveal any new rows, we execute the scroll with a repaint
(i.e., no layout). If the scroll reveals a new row, we trigger a layout
to change the set of materialized children in the viewport.
2016-01-04 11:23:42 -08:00
Adam Barth
46a178dce6 Generalize grid layout
This patch make grid layout much more flexible. The behavior is factored
out into a GridDelegate that's modeled after the custom layout
delegates. The patch includes a MaxTileWidthGridDelegate that implements
the old behavior and a FixedColumnCountGridDelegate that implements a
grid layout with a fixed number of columns.

Fixes #1048
2016-01-02 14:30:45 -08:00
Ian Hickson
ade93651ac Refactor bindings. 2015-12-13 23:34:41 -08:00
Jim Beveridge
8bb09dbcf8 Added rotation test for new PageableList code. 2015-12-10 11:19:01 -08:00
Adam Barth
ab89d2e499 Update to the new TextDecoration API
Now with fewer lists.
2015-12-09 15:11:34 -08:00
Hans Muller
c1d42a2fde Revised PageableList 2015-12-09 14:10:14 -08:00
Adam Barth
13f9e91f63 Cleanup the global scope a bit:
- Remove unused FocusChanged typedef.
- Remove unused centerOfAttentionHeroTag.
- Modernize static functions for interacting with Scrollable by moving them
  into the Scrollable class.
2015-12-09 11:12:12 -08:00
Ian Hickson
2afa87dfcd Make BoxDecoration replaceable.
Factor out a reusable interface called Decoration from BoxDecoration.

Make all the consumers of BoxDecoration and the erstwhile BoxPainter
into consumers of Decoration.

Make a BoxPainter be something you get from a Decoration, rather than
something to which you pass a BoxDecoration.

Rename Shape to BoxShape now that it's documented specifically as
applying to boxes.

Move EdgeDims to its own file.

Move FractionalOffset up so that it's with the other helper classes in
its file rather than alone at the end.

Minor change to RenderClipOval's hit testing to avoid taking an
unnecessary square root.

Rename BoxDecorationPosition to DecorationPosition since
RenderDecoratedBox now takes any Decoration.

Implement hit testing for rounded rects.

Rename AnimatedBoxDecorationValue to AnimatedDecorationValue, and make
it support lerping across any Decoration (by deferring to the objects
involved).
2015-12-07 19:24:25 -08:00
Ian Hickson
f162555648 PointerInput refactor
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.
2015-12-04 22:42:38 -08:00
Adam Barth
abf0359569 Remove PaintingCanvas
We can just use Canvas now.  The two are the same thing.
2015-12-04 20:26:08 -08:00
Collin Jackson
c253ca627b Support for hero transitions underneath a PageRoute 2015-12-04 14:26:31 -08:00
Adam Barth
e17c3eccf6 Automatically fill in the menu button when there's a drawer
Also, fill in a back arrow when we can go back.

Fixes #699
2015-12-03 16:30:06 -08:00
Adam Barth
1d195cb995 Fix a large number of Drawer bugs
This patch restructures how we handle drawer. The drawer is now a child of the
Scaffold, which wraps the Drawer in a DrawerController. The DrawerController
manages the interaction with the navigator as well as the edge swiping. The
DrawerController's state machine is driven almost entirely off its Performance,
which it now owns completely.

Fixes #90
Fixes #187
Fixes #192
Fixes #194
Fixes #604
2015-12-03 10:12:56 -08:00
Adam Barth
f538d3b750 Add liftToOverlay to Mimicable
This patch integrates Mimicable with Overlay such that you can tell a Mimicable
to lift up into the overlay and animate towards another widget identified by a
global key.
2015-12-02 14:20:56 -08:00