Skip to content

Commit

Permalink
Improve the SliverChildBuilderDelegate docs for folk to troubleshoo…
Browse files Browse the repository at this point in the history
…t. (#103183)
  • Loading branch information
xu-baolin authored Jun 7, 2022
1 parent 48d04b5 commit da19a88
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/flutter/lib/src/widgets/sliver.dart
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,11 @@ class SliverChildBuilderDelegate extends SliverChildDelegate {
/// Should return null if asked to build a widget with a greater index than
/// exists.
///
/// May result in an infinite loop or run out of memory if [childCount] is null
/// and the [builder] always provides a zero-size widget (such as `Container()`
/// or `SizedBox.shrink()`). If possible, provide children with non-zero size,
/// return null from [builder], or set a [childCount].
///
/// The delegate wraps the children returned by this builder in
/// [RepaintBoundary] widgets.
final NullableIndexedWidgetBuilder builder;
Expand All @@ -383,6 +388,11 @@ class SliverChildBuilderDelegate extends SliverChildDelegate {
///
/// If null, the number of children is determined by the least index for which
/// [builder] returns null.
///
/// May result in an infinite loop or run out of memory if [childCount] is null
/// and the [builder] always provides a zero-size widget (such as `Container()`
/// or `SizedBox.shrink()`). If possible, provide children with non-zero size,
/// return null from [builder], or set a [childCount].
final int? childCount;

/// Whether to wrap each child in an [AutomaticKeepAlive].
Expand Down

0 comments on commit da19a88

Please sign in to comment.