I am implementing below code but the sliver effect is not working at all. What wrong I am doing in the below code?
I have referred this example link, in SliverFillRemaining I just replaced the Column() with StreamBuilder(), what else should I add or remove to have the sliver effect?
return Scaffold(
body: CustomScrollView(
slivers: <Widget>[
SliverAppBar(expandedHeight: 100,
pinned: false,
flexibleSpace: FlexibleSpaceBar(
title: Text('FilledStacks'),
background: Image.asset(
'assets/user.png', // <=== Add your own image to assets or use a .network image instead.
fit: BoxFit.cover,
),
),
),
SliverFillRemaining(
child: StreamBuilder<QuerySnapshot>(
stream: query.snapshots(),
builder: (context,snapshot){
//String itemTitle = snapshot.data.documents[index]['postContent'];
if (!snapshot.hasData){
return Text("Loading");
}
return ListView.builder(
itemCount: snapshot.data.documents.length,
itemBuilder: (context, index){
String itemTitle = snapshot.data.documents[index]['itemTitle'];
return CardItem(itemTitle:itemTitle,);
});
},
),
)
],
),
);