Commit 830d163c authored by Adam Barth's avatar Adam Barth Committed by GitHub

Add more dartdocs for slivers (#9164)

This patch adds docs for many of the sliver widgets.
parent 5d8bad74
......@@ -211,8 +211,8 @@ abstract class RenderSliverFixedExtentBoxAdaptor extends RenderSliverMultiBoxAda
}
}
/// A sliver that contains multiple box children that have a given extent in the
/// main axis.
/// A sliver that places multiple box children with the same main axis extent in
/// a linear array.
///
/// [RenderSliverFixedExtentList] places its children in a linear array along
/// the main axis starting at offset zero and without gaps. Each child is forced
......
......@@ -424,8 +424,7 @@ class SliverGridParentData extends SliverMultiBoxAdaptorParentData {
String toString() => 'crossAxisOffset=$crossAxisOffset; ${super.toString()}';
}
/// A sliver that contains multiple box children that whose size and position
/// are determined by a delegate.
/// A sliver that places multiple box children in a two dimensional arrangement.
///
/// [RenderSliverGrid] places its children in arbitrary positions determined by
/// [gridDelegate]. Each child is forced to have the size specified by the
......
......@@ -24,8 +24,9 @@ import 'sliver_multi_box_adaptor.dart';
///
/// If the children have a fixed extent in the main axis, consider using
/// [RenderSliverFixedExtentList] rather than [RenderSliverList] because
/// does not need to perform layout on its children to obtain their extent in
/// the main axis and is therefore more efficient.
/// [RenderSliverFixedExtentList] does not need to perform layout on its
/// children to obtain their extent in the main axis and is therefore more
/// efficient.
///
/// See also:
///
......
......@@ -68,8 +68,7 @@ abstract class ScrollView extends StatelessWidget {
/// Defaults to [Axis.vertical].
final Axis scrollDirection;
/// Whether the scroll view scrolls in the reading direction in the
/// [scrollDirection].
/// Whether the scroll view scrolls in the reading direction.
///
/// For example, if the reading direction is left-to-right and
/// [scrollDirection] is [Axis.horizontal], then the scroll view scrolls from
......
......@@ -38,6 +38,7 @@ import 'scrollable.dart';
/// * [PageView], for a scrollable that works page by page.
/// * [Scrollable], which handles arbitrary scrolling effects.
class SingleChildScrollView extends StatelessWidget {
/// Creates a box in which a single widget can be scrolled.
SingleChildScrollView({
Key key,
this.scrollDirection: Axis.vertical,
......@@ -57,12 +58,32 @@ class SingleChildScrollView extends StatelessWidget {
);
}
/// The axis along which the scroll view scrolls.
///
/// Defaults to [Axis.vertical].
final Axis scrollDirection;
/// Whether the scroll view scrolls in the reading direction.
///
/// For example, if the reading direction is left-to-right and
/// [scrollDirection] is [Axis.horizontal], then the scroll view scrolls from
/// left to right when [reverse] is false and from right to left when
/// [reverse] is true.
///
/// Similarly, if [scrollDirection] is [Axis.vertical], then scroll view
/// scrolls from top to bottom when [reverse] is false and from bottom to top
/// when [reverse] is true.
///
/// Defaults to false.
final bool reverse;
/// The amount of space by which to inset the child.
final EdgeInsets padding;
/// An object that can be used to control the position to which this scroll
/// view is scrolled.
///
/// Must be null if [primary] is true.
final ScrollController controller;
/// Whether this is the primary scroll view associated with the parent
......@@ -75,8 +96,15 @@ class SingleChildScrollView extends StatelessWidget {
/// not specified.
final bool primary;
/// How the scroll view should respond to user input.
///
/// For example, determines how the scroll view continues to animate after the
/// user stops dragging the scroll view.
///
/// Defaults to matching platform conventions.
final ScrollPhysics physics;
/// The widget that scrolls.
final Widget child;
AxisDirection _getDirection(BuildContext context) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment