File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
packages/flutter/lib/src/widgets Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -375,6 +375,11 @@ class SliverChildBuilderDelegate extends SliverChildDelegate {
375375 /// Should return null if asked to build a widget with a greater index than
376376 /// exists.
377377 ///
378+ /// May result in an infinite loop or run out of memory if [childCount] is null
379+ /// and the [builder] always provides a zero-size widget (such as `Container()`
380+ /// or `SizedBox.shrink()` ). If possible, provide children with non-zero size,
381+ /// return null from [builder] , or set a [childCount] .
382+ ///
378383 /// The delegate wraps the children returned by this builder in
379384 /// [RepaintBoundary] widgets.
380385 final NullableIndexedWidgetBuilder builder;
@@ -383,6 +388,11 @@ class SliverChildBuilderDelegate extends SliverChildDelegate {
383388 ///
384389 /// If null, the number of children is determined by the least index for which
385390 /// [builder] returns null.
391+ ///
392+ /// May result in an infinite loop or run out of memory if [childCount] is null
393+ /// and the [builder] always provides a zero-size widget (such as `Container()`
394+ /// or `SizedBox.shrink()` ). If possible, provide children with non-zero size,
395+ /// return null from [builder] , or set a [childCount] .
386396 final int ? childCount;
387397
388398 /// Whether to wrap each child in an [AutomaticKeepAlive] .
You can’t perform that action at this time.
0 commit comments