ButtonAnimationStyle.clickable constructor

ButtonAnimationStyle.clickable({
  1. Duration duration = const Duration(milliseconds: 100),
  2. Curve curve = Curves.easeInOut,
  3. bool enableHapticFeedback = true,
  4. double translateY = 4.0,
  5. double shadowOffset = 4.0,
})

Duolingo-style 3D press effect with translateY and shadow Best for primary actions and game-like UX

Implementation

factory ButtonAnimationStyle.clickable({
  Duration duration = const Duration(milliseconds: 100),
  Curve curve = Curves.easeInOut,
  bool enableHapticFeedback = true,
  double translateY = 4.0,
  double shadowOffset = 4.0,
}) {
  return ButtonAnimationStyle._(
    type: ButtonAnimationType.clickable,
    duration: duration,
    curve: curve,
    enableHapticFeedback: enableHapticFeedback,
    translateY: translateY,
    shadowOffset: shadowOffset,
  );
}