Bounceable constructor

const Bounceable({
  1. Key? key,
  2. required VoidCallback? onTap,
  3. required Widget child,
  4. void onTapUp(
    1. TapUpDetails
    )?,
  5. void onTapDown(
    1. TapDownDetails
    )?,
  6. VoidCallback? onTapCancel,
  7. VoidCallback? onLongPress,
  8. Duration? duration = const Duration(milliseconds: 200),
  9. Duration? reverseDuration = const Duration(milliseconds: 200),
  10. Curve curve = Curves.decelerate,
  11. Curve? reverseCurve = Curves.decelerate,
  12. double scaleFactor = 0.8,
  13. HitTestBehavior? hitTestBehavior,
})

Implementation

const Bounceable({
  super.key,
  required this.onTap,
  required this.child,
  this.onTapUp,
  this.onTapDown,
  this.onTapCancel,
  this.onLongPress,
  this.duration = const Duration(milliseconds: 200),
  this.reverseDuration = const Duration(milliseconds: 200),
  this.curve = Curves.decelerate,
  this.reverseCurve = Curves.decelerate,
  this.scaleFactor = 0.8,
  this.hitTestBehavior,
}) : assert(
        scaleFactor >= 0.0 && scaleFactor <= 1.0,
        "The valid range of scaleFactor is from 0.0 to 1.0.",
      );