Last updated:
0 purchases
hideable widget
Hideable Widget #
First, create a scroll controller.
final scrollController = ScrollController();
copied to clipboard
Immediately afterwards, give this scroll controller to your scrollable widget.
ListView(
controller: scrollController,
physics: const ClampingScrollPhysics(),
children: [
...List.generate(
50,
(index) => ListTile(
title: Text("List item ${index + 1}"),
),
).toList(),
const SizedBox(height: 100),
],
),
copied to clipboard
After wrapping your static widget with the hideable widget, give the hideable widget this scroll controller.
HideableWidget(
scrollController: scrollController,
child: BottomAppBar(...)
),
copied to clipboard
That's all. Now you are ready to use the hideable widget.
Parameters are as follows. ☺️
child: This is the static widget you want to hide while scrolling.
scrollController: It should be the same as the scroll controller supplied with your scrollable widget.
useOpacity: Used to turn the opacity animation on and off. It is on by default.
duration: Use this to set the hiding time.
opacityDuration: Use this to set the opacity duration that runs during the hiding period.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.