Skip to content

Commit cb4147c

Browse files
authored
Doc Improvements (flutter#53377)
1 parent 183b3c3 commit cb4147c

File tree

3 files changed

+46
-3
lines changed

3 files changed

+46
-3
lines changed

packages/flutter/lib/src/widgets/basic.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2013,8 +2013,9 @@ class CustomMultiChildLayout extends MultiChildRenderObjectWidget {
20132013
///
20142014
/// If given a child, this widget forces its child to have a specific width
20152015
/// and/or height (assuming values are permitted by this widget's parent). If
2016-
/// either the width or height is null, this widget will size itself to match
2017-
/// the child's size in that dimension.
2016+
/// either the width or height is null, this widget will try to size itself to
2017+
/// match the child's size in that dimension. If the child's size depends on the
2018+
/// size of its parent, the height and width must be provided.
20182019
///
20192020
/// If not given a child, [SizedBox] will try to size itself as close to the
20202021
/// specified height and width as possible given the parent's constraints. If

packages/flutter/lib/src/widgets/overscroll_indicator.dart

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,47 @@ import 'ticker_provider.dart';
3232
/// (e.g., Android) that commonly use this type of overscroll indication.
3333
///
3434
/// In a [MaterialApp], the edge glow color is the [ThemeData.accentColor].
35+
///
36+
/// When building a [CustomScrollView] with a [GlowingOverscrollIndicator], the
37+
/// indicator will apply to the entire scrollable area, regardless of what
38+
/// slivers the CustomScrollView contains.
39+
///
40+
/// For example, if your CustomScrollView contains a SliverAppBar in the first
41+
/// position, the GlowingOverscrollIndicator will overlay the SliverAppBar. To
42+
/// manipulate the position of the GlowingOverscrollIndicator in this case, use
43+
/// a [NestedScrollView].
44+
///
45+
/// {@tool dartpad --template=stateless_widget_scaffold}
46+
///
47+
/// This example demonstrates how to use a [NestedScrollView] to manipulate the
48+
/// placement of a [GlowingOverscrollIndicator] when building a
49+
/// [CustomScrollView]. Drag the scrollable to see the bounds of the overscroll
50+
/// indicator.
51+
///
52+
/// ```dart
53+
/// Widget build(BuildContext context) {
54+
/// return NestedScrollView(
55+
/// headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
56+
/// return <Widget>[
57+
/// SliverAppBar(title: Text('Custom NestedScrollViews')),
58+
/// ];
59+
/// },
60+
/// body: CustomScrollView(
61+
/// slivers: <Widget>[
62+
/// SliverToBoxAdapter(
63+
/// child: Container(
64+
/// color: Colors.amberAccent,
65+
/// height: 100,
66+
/// child: Center(child: Text('Glow all day!')),
67+
/// ),
68+
/// ),
69+
/// SliverFillRemaining(child: FlutterLogo()),
70+
/// ],
71+
/// ),
72+
/// );
73+
/// }
74+
/// ```
75+
/// {@end-tool}
3576
class GlowingOverscrollIndicator extends StatefulWidget {
3677
/// Creates a visual indication that a scroll view has overscrolled.
3778
///

packages/flutter/lib/src/widgets/scroll_view.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ abstract class ScrollView extends StatelessWidget {
205205
///
206206
/// Children after [center] will be placed in the [axisDirection] relative to
207207
/// the [center]. Children before [center] will be placed in the opposite of
208-
/// the [axisDirection] relative to the [center].
208+
/// the [axisDirection] relative to the [center]. This makes the [center] the
209+
/// inflection point of the growth direction.
209210
///
210211
/// The [center] must be the key of one of the slivers built by [buildSlivers].
211212
///

0 commit comments

Comments
 (0)