@@ -8,24 +8,24 @@ import '../flutter_animate.dart';
88/// The `hz` parameter indicates approximately how many times to repeat the shake
99/// per second.
1010///
11- /// Defaults to a 5 degree (`pi / 36` ) shake, 12 times per second — equivalent to:
11+ /// Defaults to a 5 degree (`pi / 36` ) shake, 8 times per second — equivalent to:
1212///
1313/// ```
1414/// Text("Hello").animate()
15- /// .shake(hz: 12 , rotation: pi / 36)
15+ /// .shake(hz: 8 , rotation: pi / 36)
1616/// ```
1717///
1818/// There are also shortcut extensions for applying horizontal / vertical shake.
19- /// For example, this would shake 10 pixels horizontally (default is 6 ):
19+ /// For example, this would shake 10 pixels horizontally (default is 5 ):
2020///
2121/// ```
2222/// Text("Hello").animate().shakeX(amount: 10)
2323/// ```
2424@immutable
2525class ShakeEffect extends BeginEndEffect <double > {
26- static const int defaultHz = 10 ;
26+ static const int defaultHz = 8 ;
2727 static const double defaultRotation = pi / 36 ;
28- static const double defaultMove = 6 ;
28+ static const double defaultMove = 5 ;
2929
3030 const ShakeEffect ({
3131 Duration ? delay,
@@ -61,7 +61,7 @@ class ShakeEffect extends BeginEndEffect<double> {
6161 if (! shouldRotate && ! shouldTranslate) return child;
6262
6363 final Animation <double > animation = buildAnimation (controller, entry);
64- final int count = (entry.duration.inSeconds * hz).floor ();
64+ final int count = (entry.duration.inMilliseconds / 1000 * hz).round ();
6565
6666 return getOptimizedBuilder <double >(
6767 animation: animation,
0 commit comments