Merge pull request #2447 from abarth/widget_docs

Some more dartdoc
This commit is contained in:
Adam Barth 2016-03-05 18:43:35 -08:00
commit 6685954581
3 changed files with 25 additions and 0 deletions

View File

@ -999,6 +999,7 @@ class BlockBody extends MultiChildRenderObjectWidget {
}
}
/// A base class for widgets that accept [Positioned] children.
abstract class StackRenderObjectWidgetBase extends MultiChildRenderObjectWidget {
StackRenderObjectWidgetBase({
List<Widget> children: _emptyWidgetList,

View File

@ -18,6 +18,10 @@ enum ItemsSnapAlignment {
adjacentItem
}
/// Scrollable widget that scrolls one "page" at a time.
///
/// In a pageable list, one child is visible at a time. Scrolling the list
/// reveals either the next or previous child.
class PageableList extends Scrollable {
PageableList({
Key key,
@ -46,17 +50,34 @@ class PageableList extends Scrollable {
snapOffsetCallback: snapOffsetCallback
);
/// Whether the first item should be revealed after scrolling past the last item.
final bool itemsWrap;
/// Controls whether a fling always reveals the adjacent item or whether flings can traverse many items.
final ItemsSnapAlignment itemsSnapAlignment;
/// Called when the currently visible page changes.
final ValueChanged<int> onPageChanged;
/// Used to paint the scrollbar for this list.
final ScrollableListPainter scrollableListPainter;
/// The duration used when animating to a given page.
final Duration duration;
/// The animation curve to use when animating to a given page.
final Curve curve;
/// The list of pages themselves.
final Iterable<Widget> children;
PageableListState createState() => new PageableListState();
}
/// State for a [PageableList] widget.
///
/// Widgets that subclass [PageableList] can subclass this class to have
/// sensible default behaviors for pageable lists.
class PageableListState<T extends PageableList> extends ScrollableState<T> {
int get _itemCount => config.children?.length ?? 0;
int _previousItemCount;

View File

@ -12,6 +12,9 @@ class Placeholder extends StatefulComponent {
PlaceholderState createState() => new PlaceholderState();
}
/// State for a [Placeholder] widget.
///
/// Useful for setting the child currently displayed by this placeholder widget.
class PlaceholderState extends State<Placeholder> {
/// The child that this widget builds.
///