241 Commits

Author SHA1 Message Date
Hixie
a7443e75a5 Draggable
Introduce a Draggable class that wraps all the logic of dragging
something and dropping it on a DragTarget.

Update examples/widgets/drag_and_drop.dart accordingly.

Make the performance/transition part of routes optional.
2015-09-29 18:00:40 -07:00
Ian Hickson
71e96c4a02 Merge pull request #1386 from Hixie/toString
fn3: toString() and toStringDeep() debugging aids
2015-09-29 17:09:54 -07:00
Ian Hickson
8b0e60e258 Merge pull request #1376 from Hixie/toggleable
Make the checkbox in the stocks popup menu work.
2015-09-29 17:08:36 -07:00
Ian Hickson
6def36ca57 Merge pull request #1371 from Hixie/fab-snack
Make the FAB move up when a Snack Bar slides in.
2015-09-29 15:23:49 -07:00
Hans Muller
68b00481a1 SnapOffsets for fling Scrolling
Initial snap offset support for ScrollableWidgetList (and ScrollableList<T>) and ScrollableMixedWidgetList. If a ```toSnapOffset(scrollOffset)``` function is provided, fling Scrolls will coast to the returned value. If ```alignmentOffset``` is specified then fling scrolls conclude when toSnapOffset's value lines up with the Scrollable widget's origin + alignmentOffset. For example if the Scrollable widget's height was 200.0, and alignmentOffset:100.0 was specified, then fling scrolls would end with the value returned by toSnapOffset() lined up with the center of the Scrollable.

This approach to Scrollable snapping assumes that the layout of whatever the Scrollable contains is known at the outset. This is often true however a ScrollableMixedWidgetList may not know its items' sizes until they've been reached by scrolling.

This is a first cut at snapping support. Among the things that remain to be done:
- Scrolling limits trump snapping. Snapping should probably trump scrolling limits.
- Drag scrolls aren't snapped. This may be desirable so perhaps the feature should be controlled with a flag.
- Specifying alignmentOffset as a percentage would probably be more convenient.
- It would be nice if one could wrap items in a SnapOffset value like: ```new SnapOffset(0.5, child: myItem)``` to snap to the center of the item.

Updated the CardCollection example: snapping and fixed size items can be turned on/off with Drawer checkboxes.
2015-09-29 11:09:59 -07:00
Hixie
cce3801677 fn3: toString() and toStringDeep() debugging aids 2015-09-28 17:09:26 -07:00
Hixie
4942bf35e9 Make the checkbox in the stocks popup menu work.
Tapping on the menu item didn't animate the checkbox because the menu
takes 300ms to animate entirely away while the checkbox takes 200ms to
animate checked, and since the item with the checkbox was at the bottom,
we were only seeing about 60ms of the entire checkbox animation, which
isn't enough to notice it. So I moved it to the top of the menu.

Tapping on the checkbox didn't animate because nothing caused the menu
to rebuild when the callback was invoked. To trigger a rebuild, I now
call navigator.setState() explicitly, after changing out local state.

To make tapping the checkbox remove the menu, I also explicitly call
navigator.pop() in the code that handles the check. (I still explicitly
change the checkbox to show that that's possible. In principle one could
just treat the checkbox as an inert widget that happens to trigger pop,
and do all the checking/unchecking in the switch statement.)

I also made some minor style tweaks to files I was looking at while
dealing with this issue.
2015-09-28 11:15:05 -07:00
Hixie
e7ddb4ce78 Make the FAB move up when a Snack Bar slides in.
This changes how SnackBar works so you can use it anywhere, not just on
the bottom edge of the screen (it used to rely on overflowing its bounds
and having negative offsets... I'm not really sure how hit testing
worked on it before!).

To do this I introduced a new RenderBox, RenderOverflowBox, that lets
you set your child's size independent of your own. I needed this so that
the snack bar could use a SquashTransition to change its size, while not
affecting the layout of its child. This is exposed as OverflowBox in
fn3. I'm not sure if it's the best API. It doesn't let you position the
child (which is an issue if the size you give is smaller), it doesn't
let you give a loose constraint (which maybe you might want?). But it
handles this use case, so for now it's probably ok.

Making the FAB get repositioned out of the way of the Snack Bar is now
done in the Scaffold, which is in charge of positioning both of those
and is the place that knows that both exist.
2015-09-28 10:19:22 -07:00
Adam Barth
31585045ea Merge pull request #1367 from abarth/update_navigation_example
Update navigation example
2015-09-26 18:39:33 -07:00
Adam Barth
88b797bf1c Port hello_world to fn3 2015-09-26 13:18:20 -07:00
Adam Barth
f005958b72 Port address_book to fn3 2015-09-26 13:16:33 -07:00
Adam Barth
16706a94ae Update navigation example after Navigator changes
Now this example uses the App widget to drive the adventure game.
2015-09-26 13:07:46 -07:00
Adam Barth
43349f82f6 Fix analyzer warnings 2015-09-26 13:07:31 -07:00
Adam Barth
4a13cf5d1f Port MineDigger to fn3 2015-09-26 12:53:14 -07:00
Adam Barth
198f23cb53 Rename Sky to Flutter in a few more places 2015-09-26 12:46:03 -07:00
Hixie
d8ef78edcf Port stocks to fn3 and introduce an App component. 2015-09-25 17:52:33 -07:00
Viktor Lidholt
367935b777 Merge pull request #1351 from vlidholt/master
Renames pointQuickDist in GameMath
2015-09-25 13:50:48 -07:00
Viktor Lidholt
05f31c7259 Renames pointQuickDist in GameMath 2015-09-25 13:12:01 -07:00
Hixie
8c8837d63e Port ScrollableMixedWidgetListState to fn3. 2015-09-25 10:27:43 -07:00
Adam Barth
c54f91ea3b Fix typos in fn3 2015-09-25 08:42:39 -07:00
Adam Barth
6890b652c5 Port even more examples to fn3 2015-09-24 16:09:37 -07:00
Hixie
086a53d38f Rename ComponentState and use initState().
ComponentState becomes State, for brevity.
Instead of overriding its constructor, override initState().
This makes writing States much simpler.
2015-09-24 16:00:51 -07:00
Adam Barth
3f622d8b09 Port some more examples to fn3 2015-09-24 15:43:40 -07:00
Adam Barth
0eccf690ad Port Date Picker example to fn3 2015-09-24 14:46:29 -07:00
Adam Barth
fb2c9e3c95 Port big_switch.dart to fn3 2015-09-24 13:29:40 -07:00
James Robinson
8a15072435 Updates for change in Mojom dart enum generation 2015-09-24 10:35:20 -07:00
James Robinson
5bb2480bcd Update to Mojo 4e4d51ce28a8edcb32b9c7f555e38e2ae84a825e, update deps
This updates to mojo 4e4d51ce28a and mojo sdk 711a0bcfb141b4 and updates the sky
package's pubspec.yaml dependency to '>=0.1.0 <0.2.0' to be compatible with
the current mojo package. This includes an update to the Mojo Dart generator to
produce real classes for enums and the corresponding updates for users of the
KeyboardType enum in Sky as well as one scoped_ptr->std::unique_ptr in shell
corresponding to a change in the Mojo EDK.

When a new version of the sky and sky_services package are pushed this will fix
domokit/mojo#440.
2015-09-23 17:26:46 -07:00
Adam Barth
c94726ec32 Remove EventDisposition
All the use cases for EventDisposition are now addressed by the gesture
detection system.
2015-09-21 16:45:09 -07:00
Hixie
16f28c7939 Introduce a showPopupMenu() function
Instead of having to manage the popup menu from your app's build
function, you now just call showPopupMenu() with the menu's position and
it takes care of everything for you.

This solves the problem that the popup menu was trying to mutate the
state of the navigator from within its own initState() function.

Also, remove the "route" argument to RouteBase.build() since it equals
"this" by definition...

Also, remove ModalOverlay, and instead put that logic in the navigator.
2015-09-18 16:57:15 -07:00
Viktor Lidholt
655e91a28b Improvements to EffectLine in sprites 2015-09-18 15:58:16 -07:00
Adam Barth
2b57997836 Merge pull request #1234 from abarth/game_imports
SkySprites should import the public libraries
2015-09-18 12:41:11 -07:00
Adam Barth
3dbef8ac26 SkySprites should import the public libraries
Importing the public libraries caused a name conflict with dart:sky because we
assume people will import dart:sky into a namespace, so I've also changed
skysprites to import dart:sky into a namespace.
2015-09-18 11:19:39 -07:00
Hixie
8dcec9bf93 Require that you pass transitions a performance.
This fixes #1103.
2015-09-18 10:30:47 -07:00
Adam Barth
9cef3e61e9 Move theme into material.dart
Also, introduce Colors and Typography to hold the material colors and the
typography declarations. Previously we expected clients of these libraries to
import them into a namespace, but that doesn't play nice with re-exporting them
from material.dart.
2015-09-18 09:57:21 -07:00
Viktor Lidholt
263d06c533 Adds TexturedLine and animated EffectLine to sprites 2015-09-17 13:27:43 -07:00
Adam Barth
0cc094288e Move mojo frontend into services.dart
What's important about this code is that it's presenting services outside the
VM, not the particular technology used to present the services.
2015-09-16 19:13:50 -07:00
Collin Jackson
aa6251a276 Update scale API and add example 2015-09-16 17:20:23 -07:00
Adam Barth
db9c46213b Remove MimicOverlay
This widget has no client.
2015-09-16 09:27:50 -07:00
Adam Barth
8a652df63e Add dartdoc for proxy_box.dart and other code in rendering
Almost done adding dartdoc to the rendering layer.
2015-09-14 10:35:31 -07:00
Adam Barth
b0719a47b6 Remove use of some deprecated functions on sky.Paint
We now expose idiomatic setters for these properties. Eventually we'll remove
the setter functions.
2015-09-13 17:24:15 -07:00
Adam Barth
305fb7e10f Add some more docs to the rendering library 2015-09-11 15:09:38 -07:00
Matt Perry
2994380377 Compare versions before updating an app bundle.
The version and update URL are stored in the app's manifest (sky.yaml).
2015-09-10 14:17:58 -04:00
Adam Barth
c78b7d05af Remove redundant enum declarations from text_style.dart
These are now declared in dart:sky as part of ParagraphBuilder.
2015-09-10 08:03:48 -07:00
Scott Graham
7bc355c6e3 mine_digger: Fix not being able to de-flag on Android 2015-09-09 14:53:35 -07:00
Adam Barth
ad0d74a41e Introduce painting.dart and move painting code to src/painting 2015-09-08 10:36:14 -07:00
Adam Barth
ef880695d5 Introduce package:sky/animation.dart
Move the animation libraries into src/animation and change importers to use
package:sky/animation.dart. Also, move scheduler.dart into the animation
library so that the animation library can be self-contained.
2015-09-08 09:44:01 -07:00
Adam Barth
169e1d6cff Fold package:sky/editing/* into package:sky/widgets.dart
The editing directory just defined two widgets. We might as well fold them into
the main widgets library.
2015-09-07 10:07:41 -07:00
Adam Barth
79c280a703 Document and bring sanity to BoxConstraints
Turns out many of the functions on BoxConstraints weren't used or had callers
that could easily be updated to other functions. I've added dartdoc to all the
public functions as well as renamed some functions that had similar names but
did different things.
2015-09-05 11:33:02 -07:00
Hans Muller
12692debe7 Merge pull request #1066 from HansMuller/more-dismissable-unit-tests
Add Dismissable unit tests

Add coverage for the DismissDirection paramter.
2015-09-04 14:45:46 -07:00
Hans Muller
f621e01c3b Add Dismissable unit tests 2015-09-04 14:31:03 -07:00