I've develop an app.There is a page like this:
If there are more comments, the picture and comment list can be scroll.So I put them in a CustomScrollView.The question is how can I set background for the SliverList?
use this:
Add a grouping background by customizing the RenderSliver.: https://github.com/mrdaios/flutter_group_sliver
flutter_group_sliver: ^0.0.2
You can wrap the 'CustomScrollView' on a Container, and set a color for that Container. This is how I solved:
Widget build(BuildContext context) {
return Container(
color: Colors.white,
child: CustomScrollView(
slivers: <Widget>[
SliverAppBar(
title: Text('Title'),
expandedHeight: 100.0,
flexibleSpace: FlexibleSpaceBar(),
),
SliverList(
delegate: SliverChildListDelegate([]),
)
],
),
);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With