ScrollToHide class
A widget that hides its child when the user scrolls down and shows it again when the user scrolls up. This behavior is commonly used to hide elements like a bottom navigation bar to provide a more immersive user experience.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- ScrollToHide
Constructors
- ScrollToHide.new({Key? key, required Widget child, required ScrollController scrollController, Duration duration = const Duration(milliseconds: 300), required Axis hideDirection, double offset = 50, required double startBottomPosition, required double endBottomPosition})
-
Creates a
ScrollToHide
widget.const
Properties
- child → Widget
-
The widget that you want to hide/show based on the scroll direction.
final
- duration → Duration
-
The duration of the animation when the child widget is hidden or shown.
final
- endBottomPosition → double
-
The initial width of the child widget, its width will be animated to 0 .by providing width you want the hide direction to be horizontal.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hideDirection → Axis
-
The initial width of the child widget, its width will be animated to 0 .by providing width you want the hide direction to be horizontal.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- offset → double
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollController → ScrollController
-
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.final - startBottomPosition → double
-
The initial height of the child widget. When the widget is hidden, its height will be animated to 0.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< ScrollToHide> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited