Commit Graph

221 Commits

Author SHA1 Message Date
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
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
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
1f1e050163 Add drop down buttons to Material Gallery 2015-11-23 16:17:29 -08:00
Adam Barth
b17fe3afb2 Integrate Date Picker into material_gallery 2015-11-23 15:55:03 -08:00
Hixie
6e371875e9 Route refactor
- Removed the concept of ephemeral routes.
- Renamed the two _MenuRoutes to _PopupMenuRoute and _DropDownRoute.
- Added type arguments in various places:
  - DropDownMenu
  - _DropDownRoute
  - _ModalBottomSheetRoute
  - PopupMenuItem
  - _PopupMenu
  - _PopupMenuRoute
- Made _ModalBottomSheetRoute, the two ex _MenuRoutes, and _DialogRoute
  all inherit from ModalRoute, via PopupRoute.
- Change "Dropdown" and "DropDown" to "DropDown" consistently.
- Made MaterialPageRoute inherit from PageRoute.
- Made ModalBarrier not create a box if it's always transparent.
- Exposed the Futures on TransitionRoutes.
- Fixed that menus were no longer dismissable by tapping the modal
  barrier.
2015-11-20 14:56:07 -08:00
Adam Barth
72329cf422 Callback identity is too fragile for CustomPaint
Many of the widgets that use CustomPaint were spamming repaints because
CustomPaint repaints when the identity of the onPaint callback changes, which
it does every build for StatelessComponents.

This patch changes CustomPaint to use a CustomPainter, similar to the new
custom layout widgets. The CustomPainter has a `shouldRepaint` function along
with its `paint` function. This function gives clients explicit control over
when the custom paint object repaints.
2015-11-20 08:20:59 -08:00
Hans Muller
0dc652bd66 Corrected Card resting elevation, tabs example toolbar 2015-11-18 14:33:08 -08:00
Hans Muller
d9153a13c6 Update shadow rendering
Shadows now render as three seprate MaskFilter.blur components per the most recent Material spec.

The shadows Map was replaced by a similar Map called elevationToShadow with entries that match the 10 elevations specifed by http://www.google.com/design/spec/what-is-material/elevation-shadows.html.

The "level" property (many classes) is now called "elevation", to match the Material spec.

BoxShadow now includes a spreadRadius parameter - as in CSS box-shadow. Renamed the BoxShadow blur property to blurRadius to further align BoxShadow with CSS box-shadow.
2015-11-18 07:58:28 -08:00
Ian Hickson
1d3f734a92 Merge pull request #414 from Hixie/fix-demos
Fix some examples.
2015-11-17 09:53:54 -08:00
Adam Barth
c769d120c4 Add a Positioned constructor from a Rect
A common pattern is to use a Positioned with a Sized box to give both an offset
from the edge as well as a fixed size to the child. This patch rolls into into
the Stack layout algorithm for simplicity.

Fixes #250
2015-11-16 23:23:54 -08:00
Hixie
5e221334fa Fix some examples.
- drag and drop was using the wrong draggables (long press vs short
  press).

- navigation.dart wasn't using material correctly and so was ending up
  with some red text.

- piano wasn't followig our style guide even a little.

- date picker was not scrollable.
2015-11-16 15:54:40 -08:00
Collin Jackson
e3b9094f2a Fix #104 Support for setting HTTP headers 2015-11-16 14:10:58 -08:00
Adam Barth
4cb0ae4901 Add an example for launching a URL 2015-11-13 14:16:25 -08:00
Ian Hickson
1aa2751ba8 Trivial whitespace fixes. 2015-11-12 22:10:16 -08:00
Devon Carew
49b7fee4c7 add a flutter.yaml file for the widgets project 2015-11-12 13:42:54 -08:00
Ian Hickson
4a71f38224 Merge pull request #332 from Hixie/flutter-analyze
flutter analyze command
2015-11-12 12:28:48 -08:00
Hixie
a0227cab15 flutter analyze command
Other changes in this patch:
- Make the 'flutter' tool say "Updating flutter tool..." when it calls
  pub get, to avoid confusion about what the pub get output is about.
- Make the bash flutter tool call pub get when the revision has
  changed. (This was already happening on Windows.)
- Fix a raft of bugs found by the analyzer.
- Fix some style nits in various bits of code that happened to be near
  things the analyzer noticed.
- Remove the logic in "flutter test" that would run "pub get", since
  upon further reflexion it was determined it didn't work anyway.
  We'll probably have to add better diagnostics here and say to run the
  updater script.
- Remove the native velocity tracker script, since it was testing code
  that has since been removed.

Notes on ignored warnings:
- We ignore warnings in any packages that are not in the Flutter repo or
  in the author's current directory.
- We ignore various irrelevant Strong Mode warnings. We still enable
  strong mode because even though it's not really relevant to our needs,
  it does (more or less accidentally) catch a few things that are
  helpful to us.
- We allow CONSTANTS_LIKE_THIS, since we get some of those from other
  platforms that we are copying for sanity and consistency.
- We allow one-member abstract classes since we have a number of them
  where it's perfectly reasonable.
- We unfortunately still ignore warnings in mojom.dart autogenerated
  files. We should really fix those but that's a separate patch.
- We verify the actual source file when we see the 'Name non-constant
  identifiers using lowerCamelCase.' lint, to allow one-letter variables
  that use capital letters (e.g. for physics expressions) and to allow
  multiple-underscore variable names.
- We ignore all errors on lines that contain the following magic
  incantation and a "#" character:
    // analyzer doesn't like constructor tear-offs
- For all remaining errors, if the line contains a comment of the form
    // analyzer says "..."
  ...then we ignore any errors that have that "..." string in them.
2015-11-12 12:23:29 -08:00
Adam Barth
0259ad81db ItemBuilder should also get the index of the item
This seems useful for numbering the entries in the list, for example.

Fixes #328
2015-11-12 12:05:42 -08:00
Collin Jackson
cbc743f179 Remove unneeded null check in raw keyboard example 2015-11-11 11:05:11 -08:00
Collin Jackson
b79c78c05e Raw keyboard example 2015-11-11 10:55:06 -08:00
Adam Barth
b1a17cb0f8 Fix remaining analyzer warnings
Constructor tear-offs aren't supported by the analyzer yet.
2015-11-10 14:12:15 -08:00
Collin Jackson
c3f55dcec2 Fix #104 by adding support for HTTP post using DataPipeFiller 2015-11-09 16:40:24 -08:00
Adam Barth
08539b4e4d Rewire the pubspecs to use local paths
Using local paths ensures that each package sees each other package at HEAD.
2015-11-06 22:46:52 -08:00
Hans Muller
ef866e00a3 Replace Align shrinkWrap parameter with widthFactor and heightFactor 2015-11-05 16:45:05 -08:00
Hixie
255ed0b951 Make Draggable use gestures
Draggable is now itself a gesture arena member. This means it won't
conflict with other gesture recognisers in the same path.

This also allows variants of Draggable that are triggered by other
gestures.

Also, some cleanup of DoubleTapGestureRecognizer, GestureDetector, and
PrimaryPointerGestureRecognizer.

Also, make MultiTapGestureRecognizer support a timeout for longpress.

Also, make Draggable data be typed.

Also, hide warnings about constructor warnings for now. Analyzer doesn't
support them yet. (Have to do this on a per-line basis)

Directions for future research:
 - animating the avatar (enter/exit transitions)
 - interaction with the navigator (canceling a drag on page navigation, etc)
 - double-tap draggable
2015-11-05 15:16:59 -08:00
Hans Muller
fe3aee88c7 added ToolBar.withSizeOffsets() 2015-11-03 14:16:45 -08:00
Hans Muller
1b578e9eeb message string 2015-11-03 14:16:45 -08:00
Hans Muller
6f22661543 Extended height toolbar 2015-11-03 14:16:45 -08:00
Hixie
0f0108d7b6 Convert the scale demo to a general gestures demo. 2015-11-03 12:26:02 -08:00
Adam Barth
e971f32648 Rev pubspecs 2015-11-02 13:19:55 -08:00
Adam Barth
74d6f33f5a Rename Icon's type paramter to icon
The name of the parameter wasn't consistent with IconButton or DrawerItem, etc.

Fixes #1871
2015-11-01 11:25:17 -08:00
Adam Barth
50a177b7aa Switch to Navigator2 2015-10-29 23:18:56 -07:00
Hixie
fca9b8f3d6 Rev package versions for release.
sky_engine is now at 0.0.45
sky_services is now at 0.0.45
flx is now at 0.0.4
flutter is now at 0.0.15
flutter_sprites is now at 0.0.12
2015-10-29 14:41:56 -07:00
Adam Barth
fab160cfce Rationalize embedder.dart and shell.dart
This patch combines embedder.dart and shell.dart into one thing. We should now
handle a bunch of error cases better.

  * embedder.connectToApplication has moved to shell.connectToApplication,
    matching the rest of the mojo universe.
  * embedder.connecttoService has moved to shell.connnectToService (and merged
    with shell.requestService).
  * shell.requestService is now shell.connectToService, matching the rest of
    the mojo universe.
  * serviceRegistry has moved from embedder.serviceRegistry to a top-level
    getter.

Fixes #1803
2015-10-29 10:47:34 -07:00
Adam Barth
5b3b3dfb3a Merge pull request #1862 from abarth/navigator2
Add an initial implementation of Navigator2
2015-10-28 17:00:12 -07:00
Hans Muller
90a3a20d83 Merge pull request #1860 from HansMuller/tabs
Correct TabNavigatorWidth, tabs.dart example
2015-10-28 16:40:50 -07:00