Unverified Commit 80fffe5a authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

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

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