ScrollWrapper class
Wrap the widget to show a scroll to top prompt over when a certain scroll offset is reached.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- ScrollWrapper
Constructors
- ScrollWrapper({Key? key, required ScrollBuilder builder, ScrollController? scrollController, Axis scrollDirection = Axis.vertical, bool? primary, bool reverse = false, VoidCallback? onPromptTap, double scrollOffsetUntilVisible = 200, double scrollOffsetUntilHide = 200, double enabledAtOffset = 500, bool alwaysVisibleAtOffset = false, Curve scrollToTopCurve = Curves.fastOutSlowIn, Duration scrollToTopDuration = const Duration(milliseconds: 500), Duration promptDuration = const Duration(milliseconds: 500), Curve promptAnimationCurve = Curves.fastOutSlowIn, Alignment? promptAlignment, PromptButtonTheme? promptTheme, PromptAnimation promptAnimationType = PromptAnimation.size, ReplacementBuilder? promptReplacementBuilder})
-
const
Properties
- alwaysVisibleAtOffset → bool
-
If the prompt is to be always visible at the provided offset. Setting this
to false only shows the prompt when the user starts scrolling upwards.
Default value is false.
final
- builder → ScrollBuilder
-
The widget to show the prompt over when scroll is at an offset.
final
- enabledAtOffset → double
-
At what scroll offset to enable the prompt on.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onPromptTap → VoidCallback?
-
Callback function to be executed when the prompt is tapped.
final
- primary → bool
-
Whether this is wrapped around a primary scroll view associated with the parent
PrimaryScrollController.
Defaults to true when scrollDirection is Axis.vertical and
controller
is null.final - promptAlignment → Alignment?
-
Where on the widget to align the prompt.
final
- promptAnimationCurve → Curve
-
Animation Curve that the prompt will follow when coming into view.
final
- promptAnimationType → PromptAnimation
-
PromptAnimation type that the prompt will follow when coming into view.
Default is PromptAnimation.size.
final
- promptDuration → Duration
-
Duration it takes for the prompt to come into view/vanish.
final
- promptReplacementBuilder → ReplacementBuilder?
-
Replace the prompt button with your own custom widget. Returns the
BuildContext and the Function to call to scroll to top.
final
- promptTheme → PromptButtonTheme?
-
Modify the prompt theme by providing a custom PromptButtonTheme.
final
- reverse → bool
-
Whether the scroll view scrolls in the reading direction.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollController → ScrollController?
-
ScrollController of the scrollable widget to scroll to the top of when
the prompt is pressed.
final
- scrollDirection → Axis
-
The axis along which the scroll view scrolls.
final
- scrollOffsetUntilHide → double
-
If alwaysVisibleAtOffset is false, at what offset should the user scroll
before the prompt hides itself, if visible.
final
- scrollOffsetUntilVisible → double
-
If alwaysVisibleAtOffset is false, what offset should the user scroll in
the opposite direction (ex, upwards scroll on a non-reversed vertical
ScrollView) before the prompt becomes visible.
final
- scrollToTopCurve → Curve
-
Animation Curve for scrolling to the top.
final
- scrollToTopDuration → Duration
-
Duration it takes for the page to scroll to the top on prompt button press.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → ScrollWrapperState -
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}) → 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