animator 3.3.0 animator: ^3.3.0 copied to clipboard
A Flutter library that makes animation easer. It allows for separation of animation setup from the User Interface.
[3.3.0] #
- Update to be compatible with dart 3
[3.2.0] #
- Update to use states_rebuilder new version
[3.1.0] #
- add
AnimateWidget
for implicit and explicit animation.
[3.0.0] #
- update to null safety
[2.0.2] #
- update dependencies
[2.0.1] #
- update dependencies
[2.0.0] #
Breaking changes: #
- Remove explicit-like animation.
- Remove
BuilderMap
. - Change the signature of the
builder
parameter.Animator<T>( builder : (BuildContext context, AnimatorKey animatorState, Widget child) { //to get animation value: final T value = animatorState.value; //to get Animation object: final Animation<T> animation = animatorState.animation; //to get AnimationController object: final AnimationController animation = animatorState.controller; //to get animation value form tweenMap final R value =animatorState.getValue<R>('animName'); //To get Animation object from tweenMap final Animation<R> value =animatorState.getAnimation<R>('animName'); } )
New features #
- Add child parameter to
Animator
widget - Add
AnimatorKey
. It is similar to Flutter global key. It allows to control the animation from outside the Animator widget it is associated with. #24.
Example:
final animatorKey = AnimatorKey();
//..
//..
Animator(
animatorKey: animatorKey,
builder: (context, anim, child) {
//....
}
)
//By default, the animation will not start when the Animator is inserted in the widget tree.
//To start the animation from some Button in the widget tree outside the builder of the Animator.
onPressed: (){
animatorKey.triggerAnimation();
//You can forward, start, reverse animation
animatorKey.controller.stop,
//You can configure the animation online and reset the setting and restart the animation
animatorKey.refreshAnimation(
tween: Tween(...),//new tween
duration : Duration(...),
curve : Curve(...),
repeats : ....,
cycles : ...
);
}
- Add the
AnimatorRebuilder
widget. It can subscribe to an “AnimatorKey”. It will be animated in synchronization with the Animator widget with whichanimatorKey
is associated.
Example:
final animatorKey = AnimatorKey<T>(initialValue: 10);
//..
//..
Animator(
animatorKey: animatorKey,
builder: (context, anim, child) {
//....
}
);
//
//In another place in the widget tree :
AnimatorRebuilder(
observe:()=> animatorKey,
builder: (context, anim, child) {
//....
//this widget receives the same animation object of the Animator above.
}
);
[1.0.0+5]. #
- Add Continuos integration and code coverage support.
[1.0.0+3]. #
- Update to use states_rebuilder: ^1.8.0
[1.0.0+1]. #
- Refactor code.
- Fix typos.
[1.0.0]. #
- You can nest Animator Widget with different tween, duration and curve.
- Refactor code and test it.
- Explicit-like animation are used with
StateWithMixinBuilder
widget. - Update to use states_rebuilder: ^1.5.0.
[0.1.4]. #
- update to use states_rebuilder: ^1.3.2
[0.1.3]. #
- update to use states_rebuilder: ^1.3.1
- Fiw typos
[0.1.2]. #
- update to use states_rebuilder: ^1.2.0
- resetAnimationOnRebuild default to false.
[0.1.1]. #
- Remove animateOnRebuild and add triggerOnInit.
- Improve the logic
- Changed
stateID
toname
[0.1.0]. #
-
Extend the functionality of Animator widget by the following arguments:
customListener
andstatusListener
: to listen to the animation and animation status;animateOnRebuild
andresetAnimationOnRebuild
: to control whether the animation should restart or reset when Animator widget is rebuilt;stateID
andblocs
: to rebuild the Animator widget from the logic blocs using the states_builder package.
-
Fix some typos and improve the documentation