@@ -32,6 +32,47 @@ import 'ticker_provider.dart';
32
32
/// (e.g., Android) that commonly use this type of overscroll indication.
33
33
///
34
34
/// 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}
35
76
class GlowingOverscrollIndicator extends StatefulWidget {
36
77
/// Creates a visual indication that a scroll view has overscrolled.
37
78
///
0 commit comments