wiggle_kit 1.0.5 copy "wiggle_kit: ^1.0.5" to clipboard
wiggle_kit: ^1.0.5 copied to clipboard

A Flutter widget that wraps any child with plug-and-play wiggle animations. Supports 7 animation types, amplitude, duration, repeat count, and a controller to trigger animations programmatically.

wiggle_kit #

Add delightful wiggle animations to any Flutter widget in one line.

pub version likes popularity license


🎬 Preview #

All wiggle types Amplitude & speed Tap to trigger

✨ Features #

  • 7 animation types — rotate, shake, bounce, pulse, swing, jello, spin
  • Amplitude control — dial up or down how intense the wiggle is
  • Speed control — set how fast each cycle runs
  • Finite or infinite — loop forever or stop after N cycles
  • Manual trigger — fire the animation from anywhere with WiggleController
  • Auto reset — returns to original position after a finite animation ends
  • Universal — wraps any widget: buttons, icons, cards, dialogs, and more
  • Haptic feedback — optionally pair any wiggle with a haptic tap via WiggleHapticConfig
  • Zero config — haptic is opt-in, existing usage is unchanged

📦 Installation #

Add to your pubspec.yaml:

dependencies:
  wiggle_kit: ^1.0.4

Then run:

flutter pub get

🚀 Quick start #

import 'package:wiggle_kit/wiggle_kit.dart';

WiggleKit(
  type: WiggleType.shake,
  child: Icon(Icons.notifications),
)

🛠️ Usage #

Infinite loop #

WiggleKit(
  type: WiggleType.bounce,
  child: Icon(Icons.location_on),
)

Finite count — resets after N cycles #

WiggleKit(
  type: WiggleType.shake,
  count: 3,
  child: Icon(Icons.phone),
)

Amplitude — control intensity #

WiggleKit(
  type: WiggleType.shake,
  amplitude: 2.0, // default: 1.0
  child: Icon(Icons.phone),
)

Duration — control speed #

WiggleKit(
  type: WiggleType.rotate,
  duration: Duration(milliseconds: 150),
  child: Icon(Icons.settings),
)

WiggleController — trigger on demand #

final _controller = WiggleController();

WiggleKit(
  type: WiggleType.swing,
  count: 3,
  controller: _controller,
  child: Icon(Icons.notifications),
)

// Fire from a button, network event, timer, etc.
ElevatedButton(
  onPressed: _controller.start,
  child: Text('Wiggle'),
)

Haptic feedback #

Pair any wiggle with a haptic tap when the animation starts:

WiggleKit(
  type: WiggleType.shake,
  count: 3,
  hapticConfig: WiggleHapticConfig(type: FeedbackType.heavy),
  child: Icon(Icons.phone),
)

Works with all 10 FeedbackType values from haptic_feedback_pro: light, medium, heavy, soft, rigid, success, warning, error, selection, vibration. Omit hapticConfig to disable haptics entirely.

Wrap a dialog #

showDialog(
  context: context,
  builder: (ctx) => WiggleKit(
    type: WiggleType.bounce,
    count: 3,
    child: AlertDialog(
      title: Text('Hello!'),
      content: Text('This dialog wiggles.'),
      actions: [
        TextButton(
          onPressed: () => Navigator.pop(ctx),
          child: Text('Close'),
        ),
      ],
    ),
  ),
);

🎭 Animation types #

Type Description
rotate Rocks left and right around the center
shake Translates horizontally
bounce Translates vertically
pulse Scales in and out
swing Rotates around the top center like a pendulum
jello Alternates scaleX and scaleY for a squish effect
spin Continuous 360° rotation

⚙️ Parameters #

Parameter Type Default Description
child Widget required The widget to animate
type WiggleType WiggleType.rotate Animation style
duration Duration 200ms Duration of each half-cycle
amplitude double 1.0 Intensity multiplier
count int? null Cycle count — null means infinite
controller WiggleController? null Manual trigger — if provided, auto-start is disabled
hapticConfig WiggleHapticConfig? null Haptic feedback on animation start — omit to disable

🌟 Built By #

Enjoyed this package? Check out the app we built it for 🚀

Download NutriScan


🤝 Contributing #

Pull requests are welcome. For major changes, please open an issue first to discuss what you'd like to change.

📄 License #

MIT

1
likes
140
points
311
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Flutter widget that wraps any child with plug-and-play wiggle animations. Supports 7 animation types, amplitude, duration, repeat count, and a controller to trigger animations programmatically.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, haptic_feedback_pro

More

Packages that depend on wiggle_kit