flutter_animate library

Classes

Adapter
Adapters provide a mechanism to drive an animation from an arbitrary source. For example, synchronizing an animation with a scroll, controlling an animation with a slider input, or progressing an animation based on the time of day.
Animate
The Flutter Animate library makes adding beautiful animated effects to your widgets simple. It supports both a declarative and chained API. The latter is exposed via the Widget.animate extension, which simply wraps the widget in Animate.
AnimateList<T extends Widget>
Applies animated effects to a list of widgets. It does this by wrapping each widget in Animate, and then proxying calls to all instances. It can also offset the timing of each widget's animation via interval.
BlurEffect
An effect that animates a blur on the target (via ImageFiltered) between the specified begin and end blur radiuses. Defaults to begin=0, end=4.
BoxShadowEffect
An effect that animates a BoxShadow between begin and end (via DecoratedBox). You can also specify a borderRadius that defines rounded corners for the shadow. A value of null will be interpreted as a shadow that matches the other shadow but with a zero offset and blurRadius. Defaults to begin=null, end=BoxShadow(color: Color(0x80000000), blurRadius: 8.0, offset: Offset(0.0, 4.0))
CallbackEffect
An effect that calls a callback function at a particular point in the animation. It includes a boolean value indicating if the animation is playing in reverse.
ChangeNotifierAdapter
Drives an Animate animation from a ChangeNotifier. The valueGetter should provide a value in the range 0-1 when a change occurs.
ColorEffect
An effect that animates a Color between begin and end, composited with the target using blendMode (via ColorFiltered). A color value of null for will be interpreted as a fully transparent version of the other color. Defaults to begin=null, end=Color(0x800099FF).
CustomEffect
Provide an easy way to add custom animated effects via a builder method that accepts a BuildContext, target child, and calculated animation value between begin and end.
Effect<T>
An empty effect that all other effects extend. It can be added to Animate, but has no visual effect.
EffectEntry
Because Effect classes are immutable and may be reused between multiple Animate (or AnimateList) instances, an EffectEntry is created to store values that may be different between instances. For example, due to an interval on AnimateList, or from inheriting timing parameters.
ElevationEffect
An effect that animates a Material elevation shadow between begin and end (via PhysicalModel). You can also specify a shadow color and borderRadius to add rounded corners. It defaults to begin=0, end=8.
FadeEffect
An effect that animates the opacity of the target between the specified begin and end values (via FadeTransition). It defaults to begin=0, end=1.
FlipEffect
An effect that animates a 2.5D card flip rotation effect (via a matrix Transform). The effect can be horizontal or vertical.
ListenEffect
An effect that calls a callback function with its current animation value between begin and end.
MoveEffect
An effect that moves the target between the specified begin and end offsets (via Transform.translate) Defaults to begin=Offset(0, -16), end=Offset.zero. transformHitTests is simply passed on to Transform.translate.
RotateEffect
Effect that rotates the target between begin and end (via RotationTransition). Values are specified in "turns", so a begin=0.25, end=2.25 would start with the child rotated a quarter turn clockwise (90 degrees), and rotate two full turns (ending at 810 degrees). Defaults to begin=1.0, end=0.
SaturateEffect
An effect that animates the color saturation of the target. The begin and end values indicate the saturation level, where 0 is fully desaturated (ie. grayscale) and 1 is normal saturation. Values >1 will oversaturate. Defaults to begin=0, end=1.
ScaleEffect
An effect that scales the target between the specified begin and end offset values (via ScaleTransition). Defaults to begin=Offset(0,0), end=Offset(1,1).
ScrollAdapter
Drives an Animate animation from a ScrollController.
ShakeEffect
Effect that shakes the target, using translation, rotation, or both.
ShimmerEffect
An effect that enables gradient overlay effects (via ShaderMask), such as the shimmer loading effect popularized by facebook.
SlideEffect
An effect that moves the target based on a fraction of its size per the specified begin and end offsets (via SlideTransition). Defaults to begin=Offset(0, -0.5), end=Offset.zero (slide down from half its height).
SwapEffect
An effect that swaps out the incoming child for a new child at a particular point in time. This includes all preceding effects. It uses a builder so that the effect can be reused, but note that the builder is only called once when the effect initially builds.
ThenEffect
A special convenience "effect" that makes it easier to sequence effects after one another. It does this by calculating a new inheritable delay by adding the previous effect's end time (delay + duration) and its own optional delay.
TintEffect
An effect that applies an animated color tint to the target (via ColorFiltered). The begin and end values indicate the strength of the tint (0 - 0% tint, 1 - 100% tint). Defaults to begin=0, end=1.
ToggleEffect
An effect that allows you to toggle the behavior of a builder function at a certain point in time.
ValueAdapter
Drives an Animate animation directly from a value in the range 0-1
ValueNotifierAdapter
Drives an Animate animation from a ValueNotifier. The value from the notifier should be in the range 0-1.
VisibilityEffect
An effect that toggles the visibility of the target (via Visibility). Defaults to end=true.

Mixins

AnimateManager<T>
Provides a common interface for Animate and AnimateList to attach Effect extensions.

Extensions

AnimateListExtensions on List<Widget>
Wraps the target List<Widget> in a AnimateList instance. Ex. [foo, bar].animate() is equivalent to AnimateList(children: [foo, bar]).
AnimateWidgetExtensions on Widget
Wraps the target Widget in an Animate instance. Ex. myWidget.animate() is equivalent to Animate(child: myWidget).
AnimationControllerLoopExtensions on AnimationController
Adds a loop extension on AnimationController identical to repeat but adding a count parameter specifying how many times to repeat before stopping:
BlurEffectExtensions on AnimateManager<T>
BoxShadowEffectExtensions on AnimateManager<T>
CallbackEffectExtensions on AnimateManager<T>
ColorEffectExtension on AnimateManager<T>
CustomEffectExtensions on AnimateManager<T>
EffectExtensions on AnimateManager<T>
ElevationEffectExtensions on AnimateManager<T>
FadeEffectExtensions on AnimateManager<T>
FlipEffectExtensions on AnimateManager<T>
ListenEffectExtensions on AnimateManager<T>
MoveEffectExtensions on AnimateManager<T>
NumDurationExtensions on num
Adds extensions to num (ie. int & double) to make creating durations simple:
OffsetCopyWithExtensions on Offset
Adds a copyWith method to Offset.
RotateEffectExtensions on AnimateManager<T>
SaturateEffectExtensions on AnimateManager<T>
ScaleEffectExtensions on AnimateManager<T>
ShakeEffectExtensions on AnimateManager<T>
ShimmerEffectExtensions on AnimateManager<T>
SlideEffectExtensions on AnimateManager<T>
SwapEffectExtensions on AnimateManager<T>
ThenEffectExtensions on AnimateManager<T>
TintEffectExtensions on AnimateManager<T>
ToggleEffectExtensions on AnimateManager<T>
VisibilityEffectExtensions on AnimateManager<T>

Typedefs

AnimateCallback = void Function(AnimationController controller)
Function signature for Animate callbacks.
CustomEffectBuilder = Widget Function(BuildContext context, double value, Widget child)
ReparentChildBuilder = Widget Function(Widget parent, Widget child)
The builder type used by Animate.reparentTypes. It must accept an existing parent widget, and rebuild it with the provided child. In effect, it clones the provided parent widget with the new child.
ToggleEffectBuilder = Widget Function(BuildContext context, bool value, Widget child)