Is there any built in way in Flutter to hide a FloatingActionButton on ListView scrolling down and then showing it on scrolling up?
There are many ways of handing it. Let me list few here.
You can use Visibility to hide/show FAB.
floatingActionButton: Visibility(
child: FloatingActionButton(...),
visible: false, // set it to false
)
With Dart 2.2, you can use if condition like this:
floatingActionButton: Column(
children: [
if (shouldShow) FloatingActionButton(...), // visible if showShould is true
],
)
You can use Opacity widget.
floatingActionButton: Opacity(
opacity: shouldShow ? 1 : 0, // visible if showShould is true
child: FloatingActionButton(...),
)