Follow up scroll semantics update with documentation fixes (#23444)

This commit is contained in:
Jonah Williams 2018-10-25 15:09:41 -07:00 committed by GitHub
parent 883e2dc272
commit 80fffe5ac4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 16 deletions

View File

@ -715,8 +715,10 @@ class ListView extends BoxScrollView {
/// The `addAutomaticKeepAlives` argument corresponds to the
/// [SliverChildListDelegate.addAutomaticKeepAlives] property. The
/// `addRepaintBoundaries` argument corresponds to the
/// [SliverChildListDelegate.addRepaintBoundaries] property. Both must not be
/// null.
/// [SliverChildListDelegate.addRepaintBoundaries] property. The
/// `addSemanticIndexes` argument corresponds to the
/// [SliverChildListDelegate.addSemanticIndexes] property. None
/// may be null.
ListView({
Key key,
Axis scrollDirection = Axis.vertical,
@ -773,8 +775,10 @@ class ListView extends BoxScrollView {
/// The `addAutomaticKeepAlives` argument corresponds to the
/// [SliverChildBuilderDelegate.addAutomaticKeepAlives] property. The
/// `addRepaintBoundaries` argument corresponds to the
/// [SliverChildBuilderDelegate.addRepaintBoundaries] property. Both must not
/// be null.
/// [SliverChildBuilderDelegate.addRepaintBoundaries] property. The
/// `addSemanticIndexes` argument corresponds to the
/// [SliverChildBuilderDelegate.addSemanticIndexes] property. None may be
/// null.
ListView.builder({
Key key,
Axis scrollDirection = Axis.vertical,
@ -853,8 +857,10 @@ class ListView extends BoxScrollView {
/// The `addAutomaticKeepAlives` argument corresponds to the
/// [SliverChildBuilderDelegate.addAutomaticKeepAlives] property. The
/// `addRepaintBoundaries` argument corresponds to the
/// [SliverChildBuilderDelegate.addRepaintBoundaries] property. Both must not
/// be null.
/// [SliverChildBuilderDelegate.addRepaintBoundaries] property. The
/// `addSemanticIndexes` argument corresponds to the
/// [SliverChildBuilderDelegate.addSemanticIndexes] property. None may be
/// null.
ListView.separated({
Key key,
Axis scrollDirection = Axis.vertical,

View File

@ -301,8 +301,9 @@ class SliverChildBuilderDelegate extends SliverChildDelegate {
/// Creates a delegate that supplies children for slivers using the given
/// builder callback.
///
/// The [builder], [addAutomaticKeepAlives], and [addRepaintBoundaries]
/// arguments must not be null.
/// The [builder], [addAutomaticKeepAlives], [addRepaintBoundaries],
/// [addSemanticIndexes], and [semanticIndexCallback] arguments must not be
/// null.
const SliverChildBuilderDelegate(
this.builder, {
this.childCount,
@ -313,7 +314,9 @@ class SliverChildBuilderDelegate extends SliverChildDelegate {
this.semanticIndexOffset = 0,
}) : assert(builder != null),
assert(addAutomaticKeepAlives != null),
assert(addRepaintBoundaries != null);
assert(addRepaintBoundaries != null),
assert(addSemanticIndexes != null),
assert(semanticIndexCallback != null);
/// Called to build children for the sliver.
///
@ -363,10 +366,13 @@ class SliverChildBuilderDelegate extends SliverChildDelegate {
/// Typically, children in a scrolling container must be annotated with a
/// semantic index in order to generate the correct accessibility
/// announcements. This should only be set to false if the indexes have
/// already been provided by wrapping the correct child widgets in an
/// indexed child semantics widget.
/// already been provided by an [IndexedChildSemantics] widget.
///
/// Defaults to true.
///
/// See also:
/// * [IndexedChildSemantics], for an explanation of how to manually
/// provide semantic indexes.
final bool addSemanticIndexes;
/// An initial offset to add to the semantic indexes generated by this widget.
@ -461,8 +467,9 @@ class SliverChildListDelegate extends SliverChildDelegate {
/// Creates a delegate that supplies children for slivers using the given
/// list.
///
/// The [children], [addAutomaticKeepAlives], and [addRepaintBoundaries]
/// arguments must not be null.
/// The [children], [addAutomaticKeepAlives], [addRepaintBoundaries],
/// [addSemanticIndexes], and [semanticIndexCallback] arguments must not be
/// null.
const SliverChildListDelegate(
this.children, {
this.addAutomaticKeepAlives = true,
@ -472,7 +479,9 @@ class SliverChildListDelegate extends SliverChildDelegate {
this.semanticIndexOffset = 0,
}) : assert(children != null),
assert(addAutomaticKeepAlives != null),
assert(addRepaintBoundaries != null);
assert(addRepaintBoundaries != null),
assert(addSemanticIndexes != null),
assert(semanticIndexCallback != null);
/// Whether to wrap each child in an [AutomaticKeepAlive].
///
@ -504,10 +513,13 @@ class SliverChildListDelegate extends SliverChildDelegate {
/// Typically, children in a scrolling container must be annotated with a
/// semantic index in order to generate the correct accessibility
/// announcements. This should only be set to false if the indexes have
/// already been provided by wrapping the correct child widgets in an
/// indexed child semantics widget.
/// already been provided by an [IndexedChildSemantics] widget.
///
/// Defaults to true.
///
/// See also:
/// * [IndexedChildSemantics], for an explanation of how to manually
/// provide semantic indexes.
final bool addSemanticIndexes;
/// An initial offset to add to the semantic indexes generated by this widget.