From c045a0745bfbc5c4ef441a894892c91457c298e7 Mon Sep 17 00:00:00 2001 From: Kate Lovett Date: Wed, 2 Feb 2022 20:35:17 -0600 Subject: [PATCH] Update SliverChildDelegate docs (#97674) --- packages/flutter/lib/src/widgets/sliver.dart | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/packages/flutter/lib/src/widgets/sliver.dart b/packages/flutter/lib/src/widgets/sliver.dart index 1402720505..a9a3f27a27 100644 --- a/packages/flutter/lib/src/widgets/sliver.dart +++ b/packages/flutter/lib/src/widgets/sliver.dart @@ -106,6 +106,14 @@ int _kDefaultSemanticIndexCallback(Widget _, int localIndex) => localIndex; /// using the [AutomaticKeepAliveClientMixin], then implementing the /// [AutomaticKeepAliveClientMixin.wantKeepAlive] getter and calling /// [AutomaticKeepAliveClientMixin.updateKeepAlive]. +/// +/// ## Using more than one delegate in a [Viewport] +/// +/// If multiple delegates are used in a single scroll view, the first child of +/// each delegate will always be laid out, even if it extends beyond the +/// currently viewable area. This is because at least one child is required in +/// order to [estimateMaxScrollOffset] for the whole scroll view, as it uses the +/// currently built children to estimate the remaining children's extent. /// {@endtemplate} /// /// See also: @@ -788,6 +796,15 @@ abstract class SliverMultiBoxAdaptorWidget extends SliverWithKeepAliveWidget { /// The children are constructed lazily using this delegate to avoid creating /// more children than are visible through the [Viewport]. /// + /// ## Using more than one delegate in a [Viewport] + /// + /// If multiple delegates are used in a single scroll view, the first child of + /// each delegate will always be laid out, even if it extends beyond the + /// currently viewable area. This is because at least one child is required in + /// order to estimate the max scroll offset for the whole scroll view, as it + /// uses the currently built children to estimate the remaining children's + /// extent. + /// /// See also: /// /// * [SliverChildBuilderDelegate] and [SliverChildListDelegate], which are