WobbleAnimation constructor
WobbleAnimation({
- Key? key,
- required Duration duration,
- required Duration delay,
- required Widget child,
- ValueSetter<
AnimationController> ? onComplete, - required double begin,
- required double end,
- double idleValue = 0,
Implementation
WobbleAnimation({
super.key,
required super.duration,
required super.delay,
required super.child,
super.onComplete,
required double begin,
required double end,
super.idleValue = 0,
}) : super(
builder: (context, value, child) => Transform(
transform: Matrix4.identity()
..setEntry(3, 2, 0.001)
..rotateZ(sin(value * pi * 2) * 0.1),
alignment: Alignment.center,
child: child,
),
tween: Tween<double>(begin: begin, end: end),
);