I am trying to build a feed of posts (like Instagram) with a disappearing Appbar, when scrolled. Here is my code:
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.pink[100]
),
body: postImagesWidget()
);
}
Widget postImagesWidget() {
return
FutureBuilder(
future: _future,
builder: ((context, AsyncSnapshot<List<DocumentSnapshot>> snapshot) {
return LiquidPullToRefresh(
onRefresh: _refresh, // refresh callback
child: ListView.builder(
itemCount: snapshot.data.length,
itemBuilder: ((context, index) =>
SinglePost(
list: snapshot.data,
index: index,
followingUser: followingUser,
currentUser: currentUser,
fetch: fetchFeed,
)))
);
}),
);}
As you can see I am using a normal AppBar at the moment and a Listview.builder for creating the posts. I heard about the SliverAppBar and tried to implement it in my setup, but could not get it to work with my ListView.builder.
Any suggestions or ideas on how to remove the AppBar on scroll?
Best regards.