We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It would be nice to have a shaking text effect (for friendly error message for example)
The text was updated successfully, but these errors were encountered:
ok, I've managed to get it but I don't have the time to make a proper PR. Feel free to take it.
class ShakingAnimatedText extends AnimatedText { int numberOfShakes; int shakeOffset; double _animationValue = 0; ShakingAnimatedText( String text, { TextAlign textAlign = TextAlign.start, TextStyle? textStyle, Duration duration = const Duration(milliseconds: 500), this.numberOfShakes = 2, this.shakeOffset = 7, }) : super( text: text, textAlign: textAlign, textStyle: textStyle, duration: duration, ); @override Widget animatedBuilder(BuildContext context, Widget? child) { final sineValue = sin(numberOfShakes * 2 * pi * _animationValue); return Transform.translate( offset: Offset(sineValue * shakeOffset, 0), child: child, ); } @override void initAnimation(AnimationController controller) { controller.addListener(() { _animationValue = controller.value; }); } }
Sorry, something went wrong.
No branches or pull requests
It would be nice to have a shaking text effect (for friendly error message for example)
The text was updated successfully, but these errors were encountered: