16 Commits

Author SHA1 Message Date
Adam Barth
c1bd6af997 Add dartdocs for RenderObject
... and other code in object.dart.
2015-09-01 12:24:27 -07:00
Hixie
820137b7f9 Remove the inner SizeObserver from ScrollableWidgetList.
Adds a HomogeneousViewport class that works like MixedViewport but
handles only children that have all the same height.

Converts ScrollableWidgetList to use that, so that we don't waste a
frame looking at the size of the contents each time we change size.

This allows a number of seemingly pointless double-pumps in the tests
to be removed.

Other changes that were necessary to support the above:

 - RenderBlock now supports minExtent (think 'min-height' in CSS)
 - RenderBlock now supports itemExtent (forces the height of each
   child to be the same, so that the itemExtent passed to the fixed-
   height scrollables are all authoritative instead of a source of
   bugs when they don't match)
 - RenderBlockViewport now supports horizontal scrolling
 - improved the style of the isInfinite assert in box.dart
 - fixed the position of a comment in mixed_viewport.dart
 - added a test
 - made the logic for how many items to show be more precise
2015-08-31 15:57:45 -07:00
Adam Barth
35ac1f710e Add dartdoc for base 2015-08-30 13:03:03 -07:00
Adam Barth
dc84e882df Use GestureDetector in the framework and examples
We're now using it at the widget layer for everything except scrolling and
flinging.
2015-08-28 10:58:46 -07:00
Collin Jackson
f164e560c3 Add date picker to widgets library and teach fitness app to use it
Also, add an example for the date picker
2015-08-25 16:41:11 -07:00
Adam Barth
010589be9e Rename all the scrollable classes
Block -> BlockBody
ScrollableBlock -> Block
FixedHeightScrollable -> ScrollableWidgetList
VariableHeightScrollable -> ScrollableMixedWidgetList
BlockViewport -> MixedViewport
2015-08-21 14:39:41 -07:00
Adam Barth
51c7194075 Add SetRequestedOrientation to Activity service
Fixes #743
2015-08-21 12:49:49 -07:00
Adam Barth
dea3a0922c Add package:sky/rendering.dart
Similar to widgets.dart, rendering.dart exports the entire rendering layer.
Also, update the examples to use rendering.dart and widgets.dart. Also clean up
some exports so that the examples have more sensible imports.
2015-08-18 21:39:51 -07:00
Adam Barth
ac0ec3221b Add support for drag-and-drop
Widgets that want to receive drops should include a DropTarget in their build.
Currently there's no widget for initiating a drag. Components can use the
DragController directly. In the future, we'll probably want to add a Draggable
that knows how to do some of this work automatically.

Fixes #612
2015-08-17 14:06:19 -07:00
Adam Barth
5aafa65f3e Add a MimicOverlay widget
This widget lets you mimic one of its children in an overlay. The overlay
starts out as the same size of the child and then grows to fill the overlay. In
the future, the mimic will start at the same visual position as the child.
2015-08-07 11:07:19 -07:00
Adam Barth
9bed37b52c Add widgets for reparenting widgets
Wrap widgets you want to reparent in a Mimicable widget and assign the
Mimicable widget a global key. Then, given the same global key to a Mimic
widget to make it appear elsewhere in the view hierarchy.
2015-08-06 16:22:37 -07:00
Eric Seidel
7be732fe87 Add a few bits of documentation to package:sky
I can't really make further progress until at least:
https://github.com/dart-lang/dartdoc/issues/766
is resolved, ideally also:
https://github.com/dart-lang/dartdoc/issues/763

@abarth
2015-08-04 17:38:46 -07:00
Adam Barth
054ebbf3cf Rename widgets/widget.dart to widgets/framework.dart
It was confusing to have both widget.dart and widgets.dart
2015-08-04 11:13:33 -07:00
James Robinson
56a4a8ad81 Add RenderToggleable base and use in Switch and Checkbox
This refactors Checkbox to own a RenderObject similar to how Switch was
refactored in https://github.com/domokit/sky_engine/pull/376 and
extracts common functionality for toggleable renderers into a base
class.  Switch and Checkbox's render objects derive from this base
class to add their own custom painting and theming logic.
2015-08-04 10:45:30 -07:00
Adam Barth
906ff9ed1a Fix build
This file was deleted.
2015-08-03 15:52:07 -07:00
Adam Barth
e7bd46b9e9 Add a widgets.dart uber library
Now you can import 'package:sky/widgets.dart' to get all the widgets.
2015-08-03 15:09:49 -07:00