ScrollToHide constructor

const ScrollToHide({
  1. Key? key,
  2. required Widget child,
  3. required ScrollController scrollController,
  4. Duration duration = const Duration(milliseconds: 300),
  5. required Axis hideDirection,
  6. double offset = 50,
  7. required double startBottomPosition,
  8. required double endBottomPosition,
})

Creates a ScrollToHide widget.

The child, scrollController, and height parameters are required. The duration parameter is optional and defaults to 300 milliseconds.

The child is the widget that you want to hide/show based on the scroll direction.

The scrollController is the ScrollController that is connected to the scrollable widget in your app. This is used to track the scroll position and determine whether to hide or show the child widget.

The height is the initial height of the child widget. When the widget is hidden, its height will be animated to 0.

Implementation

const ScrollToHide({
  super.key,
  required this.child,
  required this.scrollController,
  this.duration = const Duration(milliseconds: 300),
  required this.hideDirection,
  this.offset = 50,
  required this.startBottomPosition,
  required this.endBottomPosition,
});