MotionPullToRefresh constructor
const
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,
Implementation
const MotionPullToRefresh({
super.key,
required this.child,
required this.onRefresh,
this.animation = MotionRefreshAnimation.liquidMorph,
this.size = 60.0,
this.color,
this.duration = const Duration(seconds: 2),
this.refreshDuration = const Duration(seconds: 3),
this.curve = Curves.easeOutBack,
this.collapseDuration = const Duration(milliseconds: 800),
this.collapseCurve = Curves.easeInOutCubic,
this.opacity = 1.0,
this.particleCount = 20,
this.glowStrength = 6.0,
this.animationSpeed = 1.0,
this.triggerDistance = 100.0,
this.settleDistance = 80.0,
this.style = MotionRefreshStyle.bouncing,
this.showStatusText = true,
this.pullText = "PULL TO REFRESH",
this.readyText = "RELEASE TO REFRESH",
this.refreshingText = "REFRESHING...",
this.statusTextStyle,
this.enableHaptics = true,
this.enableSound = false,
this.enableShadows = true,
this.adaptiveTheme = true,
this.backgroundColor,
this.foregroundColor,
this.physics = const BouncingScrollPhysics(),
this.scrollController,
});