zhaolongs / flutter_shake_animation_widget

Flutter抖动动画组件,FLutter颤动动画
Other
28 stars 17 forks source link

_ ShakeAnimationState did not consider widget reuse #1

Open klop78 opened 3 years ago

klop78 commented 3 years ago

When the layout is refreshed, the _ ShakeAnimationState does not call initState, but instead calls the didUpdateWidget notification to update

like this ` @override void didUpdateWidget(covariant ShakeAnimationWidget oldWidget) { super.didUpdateWidget(oldWidget); if (widget.shakeAnimationController != oldWidget.shakeAnimationController) { oldWidget.shakeAnimationController.removeListener(); widget.shakeAnimationController.setShakeListener(shakeListener); } }

`