From b73670a31a1efdf786e2c3d8303b24cee2a19ee8 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Sat, 5 Mar 2016 15:17:42 -0800 Subject: [PATCH] Some more dartdoc --- packages/flutter/lib/src/widgets/basic.dart | 1 + .../lib/src/widgets/pageable_list.dart | 21 +++++++++++++++++++ .../flutter/lib/src/widgets/placeholder.dart | 3 +++ 3 files changed, 25 insertions(+) diff --git a/packages/flutter/lib/src/widgets/basic.dart b/packages/flutter/lib/src/widgets/basic.dart index 016ea7e41e..6017f785e3 100644 --- a/packages/flutter/lib/src/widgets/basic.dart +++ b/packages/flutter/lib/src/widgets/basic.dart @@ -998,6 +998,7 @@ class BlockBody extends MultiChildRenderObjectWidget { } } +/// A base class for widgets that accept [Positioned] children. abstract class StackRenderObjectWidgetBase extends MultiChildRenderObjectWidget { StackRenderObjectWidgetBase({ List children: _emptyWidgetList, diff --git a/packages/flutter/lib/src/widgets/pageable_list.dart b/packages/flutter/lib/src/widgets/pageable_list.dart index 68722256b2..b0936c9e5c 100644 --- a/packages/flutter/lib/src/widgets/pageable_list.dart +++ b/packages/flutter/lib/src/widgets/pageable_list.dart @@ -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 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 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 extends ScrollableState { int get _itemCount => config.children?.length ?? 0; int _previousItemCount; diff --git a/packages/flutter/lib/src/widgets/placeholder.dart b/packages/flutter/lib/src/widgets/placeholder.dart index 534cec220b..f9ca3104bd 100644 --- a/packages/flutter/lib/src/widgets/placeholder.dart +++ b/packages/flutter/lib/src/widgets/placeholder.dart @@ -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 { /// The child that this widget builds. ///