MotionPullToRefresh constructor

const MotionPullToRefresh({
  1. Key? key,
  2. required Widget child,
  3. required Future<void> onRefresh(),
  4. MotionRefreshAnimation animation = MotionRefreshAnimation.liquidMorph,
  5. double size = 60.0,
  6. Color? color,
  7. Duration duration = const Duration(seconds: 2),
  8. Duration refreshDuration = const Duration(seconds: 3),
  9. Curve curve = Curves.easeOutBack,
  10. Duration collapseDuration = const Duration(milliseconds: 800),
  11. Curve collapseCurve = Curves.easeInOutCubic,
  12. double opacity = 1.0,
  13. int particleCount = 20,
  14. double glowStrength = 6.0,
  15. double animationSpeed = 1.0,
  16. double triggerDistance = 100.0,
  17. double settleDistance = 80.0,
  18. MotionRefreshStyle style = MotionRefreshStyle.bouncing,
  19. bool showStatusText = true,
  20. String pullText = "PULL TO REFRESH",
  21. String readyText = "RELEASE TO REFRESH",
  22. String refreshingText = "REFRESHING...",
  23. TextStyle? statusTextStyle,
  24. bool enableHaptics = true,
  25. bool enableSound = false,
  26. bool enableShadows = true,
  27. bool adaptiveTheme = true,
  28. Color? backgroundColor,
  29. Color? foregroundColor,
  30. ScrollPhysics physics = const BouncingScrollPhysics(),
  31. 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,
});