@@ -41,6 +41,9 @@ class DraggableHome extends StatefulWidget {
4141 /// backgroundColor: The color of the Material widget that underlies the entire DraggableHome body.
4242 final Color ? backgroundColor;
4343
44+ /// appBarColor: The color of the scaffold app bar.
45+ final Color ? appBarColor;
46+
4447 /// curvedBodyRadius: Creates a border top left and top right radius of body, Default radius of the body is 20.0. For no radius simply set value to 0.
4548 final double curvedBodyRadius;
4649
@@ -91,6 +94,7 @@ class DraggableHome extends StatefulWidget {
9194 required this .headerWidget,
9295 this .headerBottomBar,
9396 this .backgroundColor,
97+ this .appBarColor,
9498 this .curvedBodyRadius = 20 ,
9599 required this .body,
96100 this .drawer,
@@ -182,14 +186,18 @@ class _DraggableHomeState extends State<DraggableHome> {
182186 physics: const BouncingScrollPhysics (),
183187 slivers: [
184188 StreamBuilder <List <bool >>(
185- stream: CombineLatestStream .list <bool >(
186- [isFullyCollapsed.stream, isFullyExpanded.stream]),
189+ stream: CombineLatestStream .list <bool >([
190+ isFullyCollapsed.stream,
191+ isFullyExpanded.stream,
192+ ]),
187193 builder: (BuildContext context, AsyncSnapshot <List <bool >> snapshot) {
188194 final List <bool > streams = (snapshot.data ?? [false , false ]);
189195 final bool fullyCollapsed = streams[0 ];
190196 final bool fullyExpanded = streams[1 ];
191197
192198 return SliverAppBar (
199+ backgroundColor:
200+ ! fullyCollapsed ? widget.backgroundColor : widget.appBarColor,
193201 leading: widget.alwaysShowLeadingAndAction
194202 ? widget.leading
195203 : ! fullyCollapsed
@@ -218,6 +226,7 @@ class _DraggableHomeState extends State<DraggableHome> {
218226 children: [
219227 FlexibleSpaceBar (
220228 background: Container (
229+ margin: const EdgeInsets .only (bottom: 0.2 ),
221230 child: fullyExpanded
222231 ? (widget.expandedBody ?? const SizedBox ())
223232 : widget.headerWidget,
0 commit comments