Im new in flutter. And stacked in this problem, I have filter card on the top of my screen, and I want to hide and appear when scroll going down and up,
Thank in advance
>Solution :
use this
@override
void initState() {
super.initState();
scrollController!.addListener(() {
if (scrollController!.position.userScrollDirection ==
ScrollDirection.forward) {
if (!isFilterVisible) {
setState(() => visible = true);
}
} else if (scrollController!.position.userScrollDirection ==
ScrollDirection.reverse) {
setState(() => visible = false);
}
});
}
CustomScrollView(
controller: scrollController)