Commit Graph

187 Commits

Author SHA1 Message Date
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
Hixie
28a1788371 Semantics 2016-01-27 10:04:49 -08:00
Ian Hickson
5494323db9 Move us to HashSet to avoid the overhead of tracking the order 2016-01-23 18:13:13 -08:00
Adam Barth
432bfb4729 Add material design features to Input
Properly support labels, hints, icons, and custom typography.
2016-01-23 00:21:18 -08:00
Adam Barth
82e30c8649 Simplify colorizing icons
Now you can colorize an Icon simply by proving a Color for the Icon.
2016-01-22 12:07:45 -08:00
Hans Muller
8218ff683f Change Block children to be a named parameter 2016-01-22 08:04:21 -08:00
Adam Barth
f176ed27de Don't autofocus Input widgets by default
Instead, require the developer to opt-in to autofocusing because autofocusing
can be disruptive.

Fixes #1307
2016-01-21 14:11:50 -08:00
Hixie
24cab8999c Tooltips
Introduces a new Tooltip class.
Adds support for tooltips to IconButton and Scaffold.
Adds some tooltips to various demos.

Also some tweaks to stack.dart that I made before I decided not to go
down a "CustomPositioned" route.
2016-01-14 12:21:56 -08:00
Adam Barth
174164bc15 Switch back to GitHub hosting of stock data
The Firebase server seems to have changed behavior and is not giving us a List
instead of a Map. This patch switches us back to GitHub, which just serves the
same flat files all the time.
2016-01-14 09:37:43 -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
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
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
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
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
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
e78d6cbc6b Merge pull request #857 from Hixie/hashCodes
Use hashValues instead of hard-coded hashCode getters
2015-12-11 21:46:32 -08:00
Hans Muller
c4f52177cc demo updates 2015-12-10 12:25:59 -08:00
Ian Hickson
d8a3ed3efc Use hashValues instead of hard-coded hashCode getters 2015-12-09 22:10:33 -08:00
Hans Muller
4eeddab959 Make the StockHome TabBar selection persistent 2015-12-09 09:17:40 -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
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
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
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
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
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
Hixie
c40125e99c List assets used by Stocks demo 2015-11-25 17:11:42 -08:00
Hixie
8218a13aa4 Remove StateRoutes 2015-11-24 10:31:01 -08:00
Hixie
03e094aa1b Convert Persistent Bottom Sheets to a Scaffold API
- `Scaffold.of(context).showBottomSheet(widget);`
- Returns an object with .closed Future and .close() method.
- Uses a StateRoute to handle back button.
- Take the Navigator logic out of the BottomSheet widget.
- Support showing a sheet while an old one is going away.
- Add Navigator.remove().
2015-11-20 10:49:10 -08:00