-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
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
[New Feature] AnimateWidge for implicit without the limitation of built-in Flutter widget for implicit animation #56
Comments
Explicit AnimationWith AnimateWidget you can also do explict animation: In explicit animation you have full control on how to parametrize your animation using tweens. AnimatedWidget(
duration: const Duration(seconds: 2),
(context, animate) {
final angle = animate.fromTween(
(currentValue) => Tween(begin: 0, end: 2 * 3.14),
)!;
return Transform.rotate(
angle: angle,
child: const FlutterLogo(size: 75),
);
},
);
|
Here is the full interface of AnimateWidget AnimateWidget({
Key? key,
double? initialValue, // (1)
double lowerBound = 0.0, // (1)
double upperBound = 1.0, // (1)
Duration duration = const Duration(milliseconds: 500), // (2)
Duration? reverseDuration, // (2)
Curve curve = Curves.linear, // (3)
Curve? reverseCurve, // (3)
AnimationBehavior animationBehavior = AnimationBehavior.normal, // (4)
int? repeats, // (5)
int? cycles, // (5)
void Function()? endAnimationListener, // (6)
bool triggerOnInit = true, // (7)
bool triggerOnRebuild = false, // (7)
bool resetOnRebuild = false, // (7)
required Widget Function(BuildContext, Animate) builder,// (8)
}
)
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I added a new widget called AnimateWidget that allows for implicit without limitation.
Let's reproduce the
AnimatedContainer
example in official Flutter docs. (link here).In Flutter
AnimatedContainer
example, we see:With
animateWidget, we simply use the
Container` widget :animate
function, we set the animation start and end values.That's all, you are not limited to use a widget that starts with Animated prefix to use implicit animation.
Here is the full working example.
The text was updated successfully, but these errors were encountered: