I have loaded some news in my SliverList. I want to make this list dynamic. How to add pagination feature in my below code with SliverList?
FutureBuilder<List<Data>>(
future: getNews(),
builder: (context, snapshot){
Widget newsListSliver;
if(snapshot.hasData){
newsListSliver = SliverList(
delegate: new SliverChildBuilderDelegate((context, index){
return new NewsList(latestNews: snapshot.data.elementAt(index),);
}, childCount: snapshot.data.length),
);
}else{
newsListSliver = SliverToBoxAdapter(child: Center(child: CircularProgressIndicator(),));
}
return CustomScrollView(
slivers: <Widget>[
SliverToBoxAdapter(child: new TabPanel()),
SliverToBoxAdapter(child: new UrlButtonPanel()),
SliverToBoxAdapter(child: new ChatNowAd()),
newsListSliver
],
);
},
)