Commit Graph

952 Commits

Author SHA1 Message Date
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
Collin Jackson
d05c564cef Fix hero transition when using dynamic routes 2015-12-08 13:08:16 -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
Jason Simmons
9693cd5537 Add a LocaleQuery widget that can be used to fetch locale-specific data
Users of MaterialApp can provide an onLocaleChanged handler that will be
called to asynchronously fetch locale-specific data.  MaterialApp will
then instantiate a LocaleQuery that supplies the locale data to its
descendants.
2015-12-07 17:38:50 -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
Hixie
6c3459e0b6 Slider Improvements
Have the widget support min/max arguments to make the widget easier to
use. Also, fix the dragging so it's actually where the knob is.
2015-12-04 11:23:16 -08:00
Jason Simmons
e08d446ebf Example of using the Dart internationalization package in Flutter 2015-12-04 09:48:32 -08:00
Ian Hickson
c5a26615d8 Introduce some basic utility classes.
One might argue, the most basic utility classes.
2015-12-03 20:03: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
Ian Hickson
ab74b1783c Merge pull request #705 from Hixie/yak3-material-app-route-classes
Let MaterialApp.onGenerateRoute return a Route
2015-12-03 14:40:36 -08:00
Hixie
e249c0ab49 Add menu items to stocks to control timeDilation 2015-12-03 14:28:27 -08:00
Hixie
df07a69b12 Let MaterialApp.onGenerateRoute return a Route
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.
2015-12-03 14:21:38 -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
Hixie
bc5307f5af buildForwardTransition()
For those times when you want to do something as you move away from a
route into the next one, as well as when you move into it from the
previous one.
2015-12-02 17:16:43 -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
Ian Hickson
d5e072c35b Fix crash when going back in stocks app.
Heroes with the same tag have to have keys that are unique across the
entire subtree. Since we can now show both stock lists, this means we
have to include the tab in the heroes' keys.

Fixes #668.
2015-12-01 22:54:11 -08:00
Florian Loitsch
018bcbf2d9 Remove animation scheduler. 2015-12-01 20:36:52 -08:00
Hixie
f9ea1ce815 NavigatorTransaction
To make it easier to avoid pushing twice in one frame, provide a
transaction mechanism for the navigator.
2015-11-30 15:24:36 -08:00
Hans Muller
9de4df1e8b TabNavigator animates selected TabView
The TabBar's selection is now represented by a TabBarSelection object which encapsulates both the previous and currently selected indices and the Performance used to animate the selection indicator.

Added a TabBarView class which displays a tab's contents. It uses a shared TabBarSelection to stay in sync with a TabBar. The TabBarView scrolls in sync with the TabBar when the selection changes. Eventually it will allow one to fling the selection forward or backwards.

Added a tabBar property to ToolBar. Typically the corresponding TabBarView will be the body of the toolbar's Scaffold.

Removed TabNavigatorView and TabNavigator.

Added a widget gallery tabs demo page. Removed the old tabs demo.
2015-11-30 12:13:17 -08:00
Adam Barth
3fbfe732f4 Properly paint disabled switches
Also, refactor more common code into RenderToggleable and handle dark themes
more correctly.

Fixes #601
2015-11-26 11:50:15 -08:00
Adam Barth
0844233deb Add missing types for list literals 2015-11-26 10:40:06 -08:00
Adam Barth
3f06da0eaa Improve Material selection controls
- These controls now have proper radial reactions.
 - You can drag the switch.
 - The radio button animates properly.
 - There's a demo in the Material Gallery
2015-11-26 01:54:34 -08:00
Adam Barth
9fae3864a3 Move Material Gallery demos into a directory
Also, clean up the main.dart file to prepare for making dynamic theme changes.
2015-11-25 23:16:39 -08:00
Hixie
c40125e99c List assets used by Stocks demo 2015-11-25 17:11:42 -08:00
Adam Barth
4fa24f5695 Animate slider radial reaction
Also, have the slider draw different in its disabled state.
2015-11-25 15:01:36 -08:00
Adam Barth
abce0533b4 Merge pull request #587 from abarth/sliders
Add a basic material slider
2015-11-25 12:34:09 -08:00
Adam Barth
0c0ae4a1a2 Merge pull request #584 from abarth/time_picker
Finish TimePicker
2015-11-25 12:31:10 -08:00