1530 Commits

Author SHA1 Message Date
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
Ian Hickson
8f894f3757 Merge pull request #1140 from Hixie/concat
Transition callers from 'concat' to 'transform'
2016-01-11 20:05:07 -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
Ian Hickson
d869c01035 Merge pull request #1181 from Hixie/stats-box-rename
Rename StatisticsOverlay to PerformanceOverlay.
2016-01-11 12:21:32 -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
Matt Perry
1343a02032 Add Flutter GCM package and extend fitness app to use GCM. 2016-01-11 13:45:32 -05:00
Ian Hickson
88c43c3f4e Rename StatisticsOverlay to PerformanceOverlay. 2016-01-10 23:47:42 -08:00
Ian Hickson
48e1350e73 Add more debugging options to the stocks app.
- Add an option to enable debugPaintSizeEnabled.
- Add an option to enable the StatisticsOverlay.
- Add support for the StatisticsOverlay in MaterialApp.
- Change the layout behaviour of RenderStatisticsBox:
   - Give it a zero intrinsic width.
   - Give it an accurate intrinsic height that depends on the flags
     set. (Also, move the enum to the rendering/ layer from the
     widgets/ layer to enable this.)
   - Make the box automatically size itself full-width and the correct
     height, so that you can actually embed it (though most of the
     time you'd just put it in a Stack so this doesn't matter as
     much, really).
- Some style nit fixes in statistics_box.dart.
2016-01-10 22:42:16 -08:00
Adam Barth
dd08bf7973 Simplify TabView API
Instead of taking a builder and a generic type, we can just take a
List<Widget>.
2016-01-10 21:44:24 -08:00
Ian Hickson
34cfb6082a Refactor the Stocks app's settings
This will make it much easier to add more settings.
2016-01-10 00:36:01 -08:00
Ian Hickson
d9d3114d14 Material baseline grid
See https://www.google.com/design/spec/layout/metrics-keylines.html#
2016-01-08 11:18:15 -08:00
Ian Hickson
17ef9488ff Transition callers from 'concat' to 'transform'
See: https://github.com/flutter/flutter/issues/1080
2016-01-08 08:58:31 -08:00
Hans Muller
1b11336ee6 Page Selector gallery demo 2016-01-07 08:27:13 -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
Hans Muller
6494cd1f35 Make TabBarSelection a parameterized type 2016-01-06 10:54:16 -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
24fadf49fc Merge pull request #1070 from abarth/scrollable_list2
Introduce ScrollableList2
2016-01-04 16:44:44 -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
Ian Hickson
c8ac09a56d Merge pull request #1042 from Hixie/wordSpacing
Hook up wordSpacing and inline height.
2016-01-04 15:38:56 -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
4588524ca7 Hook up wordSpacing and inline height.
Also, trivial improvements to the baseline example that I made while
unsuccessfully trying to reproduce a baseline bug.
2015-12-30 12:05:44 -08:00
Hans Muller
6178fdff8a TabBarSelection is now expected to be an ancestor of its TabBar and TabBarView. 2015-12-22 14:12:26 -08:00
Devon Carew
6e324ef92d fix analysis errors and warnings in the stocks example 2015-12-21 13:39:28 -08:00
Eric Seidel
6d908544c4 Forgot to add the file
This is a png version of the flutter logo generated on my desktop
from the SVG in the flutter.io repository.

TBR @hansmuller
2015-12-18 08:56:58 -08:00
Eric Seidel
33604c4a58 Add an icon to the Flutter Material Gallery
@abarth @hixie
2015-12-17 12:51:57 -08:00
Eric Seidel
d3eca1aa42 Add an icon for the Stocks app.
Not great.  Better than nothing.

@hixie
2015-12-17 10:06:16 -08:00
Hans Muller
65dca5b578 Correct the TabBarView swipe selection change animation
The TabBarSelection change animation needs to start where the fling's drag gesture ended rather than from zero.  The intial vlaue of progress for the TabBarSelection's performance is now converted from the range used during an interactive drag, to the range used when animating from the previously selected tab to the new one.

TabBarSelection now requires a maxIndex parameter.
2015-12-16 15:30:45 -08:00
Ian Hickson
7151fdd054 Move flutter tests from packages/unit to packages/flutter/test 2015-12-16 08:00:57 -08:00
Hans Muller
04162cffee Added bottom sheet demos to the Material gallery 2015-12-15 16:27:22 -08:00
Eric Seidel
520ceb5859 Rename stocks/tests to stocks/test
This matches the naming pattern expected from package:test
`flutter test` doesn't care, since it finds all _test.dart
files and runs them regardless of directory.

@Hixie
2015-12-14 14:56:22 -08:00
Ian Hickson
ade93651ac Refactor bindings. 2015-12-13 23:34:41 -08:00
Ian Hickson
e78d6cbc6b Merge pull request #857 from Hixie/hashCodes
Use hashValues instead of hard-coded hashCode getters
2015-12-11 21:46:32 -08:00
Jim Beveridge
f92cd47651 Merge pull request #853 from jimbeveridge/pagetest
Added rotation test for new PageableList code.
2015-12-10 12:57:28 -08:00
Hans Muller
c4f52177cc demo updates 2015-12-10 12:25:59 -08:00
Jim Beveridge
8bb09dbcf8 Added rotation test for new PageableList code. 2015-12-10 11:19:01 -08:00
Ian Hickson
d8a3ed3efc Use hashValues instead of hard-coded hashCode getters 2015-12-09 22:10:33 -08:00
Ian Hickson
928c6290e0 Remove last traces of onEvent. 2015-12-09 21:07:06 -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
4f22f3ecde Merge pull request #838 from abarth/cleanup_global_scope
Cleanup the global scope a bit:
2015-12-09 12:44:27 -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
Hans Muller
4eeddab959 Make the StockHome TabBar selection persistent 2015-12-09 09:17:40 -08:00
Ian Hickson
1a049c14e5 Catch un-normalized BoxConstraints
Add BoxConstraints.isNormalized feature.

Use this feature in asserts in all the intrinsic dimension methods, in
various relevant BoxConstraints methods, and in layout().

Wrap the _DebugSize logic in BoxConstraints.constrain() in an assert
block to avoid a branch in release mode.

Remove the logic in BoxConstraints.isSatisfiedBy() that dealt with
non-normalized values.

Add BoxConstraints.normalize().

Make RenderCustomOneChildLayoutBox.performLayout() only set
parentUsesSize on the child if the constraints aren't tight.
2015-12-08 21:35:39 -08:00
Eric Seidel
2f4864efbb Merge pull request #825 from eseidelGoogle/locale_test
Add a test to stocks for changing the locale
2015-12-08 16:34:53 -08:00
Eric Seidel
09894ec50b Add a test to stocks for changing the locale
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
2015-12-08 16:16:24 -08:00
Seth Ladd
2666628b12 use async / await 2015-12-08 14:16:14 -08:00