ShakeWidget constructor

const ShakeWidget({
  1. Key? key,
  2. required Widget child,
  3. required dynamic controller,
  4. Duration duration = const Duration(milliseconds: 800),
  5. double deltaX = 6,
  6. int oscillations = 4,
  7. Curve curve = Curves.easeInOut,
})

Implementation

const ShakeWidget({
    super.key,
    required this.child,
    required this.controller,
    this.duration = const Duration(milliseconds: 800), // Increased duration
    this.deltaX = 6, // Slightly increased horizontal movement
    this.oscillations = 4, // Fewer oscillations for more steady shaking
    this.curve = Curves.easeInOut, // Changed to easeInOut for smoother transitions
});