MotionPullToRefresh class

Next-Generation Pull-To-Refresh widget exposing 20 premium visual animations.

Inheritance
Available extensions

Constructors

MotionPullToRefresh({Key? key, required Widget child, required Future<void> onRefresh(), MotionRefreshAnimation animation = MotionRefreshAnimation.liquidMorph, double size = 60.0, Color? color, Duration duration = const Duration(seconds: 2), Duration refreshDuration = const Duration(seconds: 3), Curve curve = Curves.easeOutBack, Duration collapseDuration = const Duration(milliseconds: 800), Curve collapseCurve = Curves.easeInOutCubic, double opacity = 1.0, int particleCount = 20, double glowStrength = 6.0, double animationSpeed = 1.0, double triggerDistance = 100.0, double settleDistance = 80.0, MotionRefreshStyle style = MotionRefreshStyle.bouncing, bool showStatusText = true, String pullText = "PULL TO REFRESH", String readyText = "RELEASE TO REFRESH", String refreshingText = "REFRESHING...", TextStyle? statusTextStyle, bool enableHaptics = true, bool enableSound = false, bool enableShadows = true, bool adaptiveTheme = true, Color? backgroundColor, Color? foregroundColor, ScrollPhysics physics = const BouncingScrollPhysics(), ScrollController? scrollController})
const

Properties

adaptiveTheme bool
Toggles dark/light base adaptive layouts.
final
animation MotionRefreshAnimation
The active MotionRefreshAnimation layout preset indicator to render.
final
animationSpeed double
Scaling multiplier for active speeds (respects global speed overrides).
final
backgroundColor Color?
Background color override of the overscroll header container.
final
child Widget
The scrollable child widget (e.g. ListView, SingleChildScrollView).
final
collapseCurve Curve
The curve applied when collapsing the header back to the top. Defaults to Curves.easeInOutCubic for a beautiful, organic easing profile.
final
collapseDuration Duration
The duration taken to smoothly collapse the top header after refresh completes. Defaults to 800 milliseconds for a sleek, premium slide-up transition.
final
color Color?
Primary color of the graphic indicators. Resolves to theme primary if null.
final
curve Curve
The curve applied to the pull/snap transitions.
final
duration Duration
Central cycle duration for active refreshing animations.
final
enableHaptics bool
Toggles system haptics feedback during progress milestones.
final
enableShadows bool
Toggles glowing dropshadow painters.
final
enableSound bool
Toggles auditive sound triggers.
final
foregroundColor Color?
Custom foreground indicator color override.
final
glowStrength double
Glow filter blur strength.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onRefresh Future<void> Function()
The asynchronous callback task triggered upon release.
final
opacity double
Base opacity of the header canvas.
final
particleCount int
Bounding count of particles/elements in physics models.
final
physics ScrollPhysics
Scroll physics wrapper applied to the notifier.
final
pullText String
Status text displayed when pulling. Defaults to "PULL TO REFRESH".
final
readyText String
Status text displayed when threshold is reached. Defaults to "RELEASE TO REFRESH".
final
refreshDuration Duration
The minimum duration the refresh indicator remains visible before hiding. Defaults to 3 seconds to let the premium visual animations run fully.
final
refreshingText String
Status text displayed during active refreshing. Defaults to "REFRESHING...".
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollController ScrollController?
final
settleDistance double
The height the header settles at during active refreshing. Defaults to 80.0 pixels.
final
showStatusText bool
Toggles the rendering of dynamic status helper text (e.g. "Pull to refresh").
final
size double
Bounding size of the loader graphics (width & height).
final
statusTextStyle TextStyle?
Custom text style for the status label.
final
style MotionRefreshStyle
The visual layout style of the refresh indicator. Defaults to MotionRefreshStyle.bouncing for organic physics-based list shifting.
final
triggerDistance double
Height threshold in pixels representing the trigger point.
final

Methods

animateFade({Key? key, double opacity = 1.0, Duration duration = const Duration(milliseconds: 300), Curve curve = Curves.easeOut}) Widget

Available on Widget, provided by the MotionWidgetExtensions extension

Wraps a widget in an easy implicit animated opacity/fade effect
animateRotation({Key? key, double turns = 0.0, Duration duration = const Duration(milliseconds: 400), Curve curve = MotionCurves.swiftOut}) Widget

Available on Widget, provided by the MotionWidgetExtensions extension

Wraps a widget in a rotation effect
animateScale({Key? key, double scale = 1.0, Duration duration = const Duration(milliseconds: 300), Curve curve = MotionCurves.swiftOut}) Widget

Available on Widget, provided by the MotionWidgetExtensions extension

Wraps a widget in an easy implicit animated scale effect
animateSlide({Key? key, Offset offset = Offset.zero, Duration duration = const Duration(milliseconds: 350), Curve curve = MotionCurves.swiftOut}) Widget

Available on Widget, provided by the MotionWidgetExtensions extension

Wraps a widget in a slide-offset animated wrapper
createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<MotionPullToRefresh>
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