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.
AlignEffect
An effect that animates the target between the specified begin and end alignments (via Align). Defaults to begin=Align.topCenter, end=Align.center.
Animate
The Flutter Animate Plus 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.
AnimateDefaults
Default effect timing for descendant Animate widgets.
AnimateDefaultsData
The effective values in a nested AnimateDefaults scope.
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.
AnimatePresence
Retains its last visible child until its exit transition finishes.
AnimationAdapter
Drives effects from an existing animation, such as the animation supplied to an AnimatedSwitcher.transitionBuilder or a route transition.
BlurEffect
An effect that animates a blur on the target between the specified begin and end blur radiuses (via ImageFiltered). Defaults to begin=0, end=4.
BlurXEffect
Declarative equivalent of .blurX().
BlurXYEffect
Declarative equivalent of .blurXY().
BlurYEffect
Declarative equivalent of .blurY().
BounceInEffect
Fades in while scaling from scale to 1. Uses a bounce curve by default. Delegates rendering to FadeInEffect and ScaleEffect.
BounceOutEffect
Fades out while scaling from 1 to scale. Uses a bounce curve by default. Delegates rendering to FadeOutEffect and ScaleEffect.
BoxShadowEffect
An effect that animates a BoxShadow between begin and end (via DecoratedBox). A value of null for either will be interpreted as a shadow that matches the other shadow but with a zero offset and blurRadius. You can also specify a borderRadius that defines rounded corners for the shadow. 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 will be interpreted as a fully transparent version of the other color. Defaults to begin=null, end=Color(0x800099FF).
CrossfadeEffect
An effect that crossfades the incoming child (including preceeding effects) with a new widget (via Stack and FadeTransition). 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.
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.
DesaturateEffect
Declarative equivalent of .desaturate().
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.
EffectList
Simple helper class to build a list of effects via the chained api. Example:
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
Animates the opacity of the target between the specified begin and end values (via FadeTransition). It defaults to begin=0, end=1.
FadeInDownEffect
Combines FadeInEffect and SlideInDownEffect on one timeline. distance defaults to one quarter of the child's size.
FadeInEffect
Declarative equivalent of .fadeIn().
FadeInLeftEffect
Combines FadeInEffect and SlideInLeftEffect on one timeline. distance defaults to one quarter of the child's size.
FadeInRightEffect
Combines FadeInEffect and SlideInRightEffect on one timeline. distance defaults to one quarter of the child's size.
FadeInUpEffect
Combines FadeInEffect and SlideInUpEffect on one timeline. distance defaults to one quarter of the child's size.
FadeOutDownEffect
Combines FadeOutEffect and SlideOutDownEffect on one timeline. distance defaults to one quarter of the child's size.
FadeOutEffect
Declarative equivalent of .fadeOut().
FadeOutLeftEffect
Combines FadeOutEffect and SlideOutLeftEffect on one timeline. distance defaults to one quarter of the child's size.
FadeOutRightEffect
Combines FadeOutEffect and SlideOutRightEffect on one timeline. distance defaults to one quarter of the child's size.
FadeOutUpEffect
Combines FadeOutEffect and SlideOutUpEffect on one timeline. distance defaults to one quarter of the child's size.
FlipEffect
An effect that animates a 2.5D card flip rotation effect (via Transform). The effect can be horizontal or vertical.
FlipHEffect
Declarative equivalent of .flipH().
FlipInXEffect
Fades in while rotating around the X axis by a quarter turn. Delegates to FadeInEffect and FlipEffect.
FlipInYEffect
Fades in while rotating around the Y axis by a quarter turn. Delegates to FadeInEffect and FlipEffect.
FlipOutXEffect
Fades out while rotating around the X axis by a quarter turn. Delegates to FadeOutEffect and FlipEffect.
FlipOutYEffect
Fades out while rotating around the Y axis by a quarter turn. Delegates to FadeOutEffect and FlipEffect.
FlipVEffect
Declarative equivalent of .flipV().
FollowPathEffect
An effect that moves the target following the specified path (via Transform). The path coordinates are relative to the target's nominal position.
FractionalSizeEffect
Animates factors of the available layout size with FractionallySizedBox.
HeightEffect
Declarative equivalent of .height().
HeightPctEffect
Declarative equivalent of .heightPct().
HideEffect
Declarative equivalent of .hide().
ImplicitAnimate
Animates changes to the endpoints of Fade, Scale, Slide and Move effects.
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.
MoveXEffect
Declarative equivalent of .moveX().
MoveYEffect
Declarative equivalent of .moveY().
RepeatAdapter
Repeats an animation with timer-based pauses between runs.
RotateEffect
Effect that rotates the target between begin and end (via RotationTransition). Values are specified in "turns" (360° or 2𝝅 radians), 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 Transform.scale). Defaults to begin=Offset(0,0), end=Offset(1,1).
ScaleXEffect
Declarative equivalent of .scaleX().
ScaleXYEffect
Declarative equivalent of .scaleXY().
ScaleYEffect
Declarative equivalent of .scaleY().
ScrollAdapter
Drives an Animate animation from a ScrollController.
ShaderEffect
Effect that applies an animated fragment shader to a target. See Writing and using fragment shaders for information on how to include shaders in your app.
ShaderUpdateDetails
Passed to the ShaderEffect.update callback. Contains information necessary for updating the shader:
ShakeEffect
Effect that shakes the target, using translation, rotation, or both (via Transform).
ShakeXEffect
Declarative equivalent of .shakeX().
ShakeYEffect
Declarative equivalent of .shakeY().
ShimmerEffect
An effect that animates gradient overlay effects (via ShaderMask), such as the shimmer loading effect popularized by facebook.
ShowEffect
Declarative equivalent of .show().
SizeEffect
Animates layout dimensions in pixels using SizedBox.
SizePctEffect
Declarative equivalent of .sizePct().
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).
SlideInDownEffect
Slides from Offset(0, -distance) to zero. distance is measured in multiples of the child's size (default 1).
SlideInLeftEffect
Slides from Offset(-distance, 0) to zero. distance is measured in multiples of the child's size (default 1).
SlideInRightEffect
Slides from Offset(distance, 0) to zero. distance is measured in multiples of the child's size (default 1).
SlideInUpEffect
Slides from Offset(0, distance) to zero. distance is measured in multiples of the child's size (default 1).
SlideOutDownEffect
Slides from zero to Offset(0, distance). distance is measured in multiples of the child's size (default 1).
SlideOutLeftEffect
Slides from zero to Offset(-distance, 0). distance is measured in multiples of the child's size (default 1).
SlideOutRightEffect
Slides from zero to Offset(distance, 0). distance is measured in multiples of the child's size (default 1).
SlideOutUpEffect
Slides from zero to Offset(0, -distance). distance is measured in multiples of the child's size (default 1).
SlideXEffect
Declarative equivalent of .slideX().
SlideYEffect
Declarative equivalent of .slideY().
SliverFadeEffect
Animates the opacity of a sliver via SliverFadeTransition.
SliverMoveEffect
Translates a sliver's painting in physical logical pixels without changing its scroll or layout extent. Defaults to (0, -16) → (0, 0).
SpringAdapter
Drives an Animate timeline with Flutter's SpringSimulation.
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 establishing a new baseline time equal to the previous effect's end time and its own optional delay. All subsequent effect delays are relative to this new baseline.
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.
UntintEffect
Declarative equivalent of .untint().
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. Supply transformer to map other input ranges to animation progress.
VisibilityEffect
An effect that toggles the visibility of the target (via Visibility). Defaults to end=true.
WidthEffect
Declarative equivalent of .width().
WidthPctEffect
Declarative equivalent of .widthPct().
ZoomInEffect
Fades in while scaling from scale to 1. Delegates rendering to FadeInEffect and ScaleEffect.
ZoomOutEffect
Fades out while scaling from 1 to scale. Delegates rendering to FadeOutEffect and ScaleEffect.

Mixins

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

Extensions

AlignEffectExtensions on T
Adds AlignEffect related extensions to AnimateManager.
AnimateListExtensions on List<Widget>
Adds AnimateList related extensions to List<Widget>.
AnimateWidgetExtensions on Widget
Adds Animate related extensions to Widget.
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 T
Adds BlurEffect related extensions to AnimateManager.
BoxShadowEffectExtensions on T
Adds BoxShadowEffect related extensions to AnimateManager.
CallbackEffectExtensions on T
Adds CallbackEffect related extensions to AnimateManager.
ColorEffectExtension on T
Adds ColorEffect related extensions to AnimateManager.
CrossfadeEffectExtensions on T
Adds CrossfadeEffect related extensions to AnimateManager.
CustomEffectExtensions on T
Adds CustomEffect related extensions to AnimateManager.
EffectExtensions on T
Adds Effect related extensions to AnimateManager.
ElevationEffectExtensions on T
Adds ElevationEffect related extensions to AnimateManager.
FadeEffectExtensions on T
Adds FadeEffect related extensions to AnimateManager.
FlipEffectExtensions on T
Adds FlipEffect related extensions to AnimateManager.
FollowPathEffectExtensions on T
Adds FollowPathEffect related extensions to AnimateManager.
ImplicitAnimateWidgetExtensions on Widget
ListenEffectExtensions on T
Adds ListenEffect related extensions to AnimateManager.
MoveEffectExtensions on T
Adds MoveEffect related extensions to AnimateManager.
NumDurationExtensions on num
Adds extensions to num (ie. int & double) to make creating durations simple:
OffsetCopyWithExtensions on Offset
Adds a copyWith method to Offset.
PresetEffectExtensions on T
Named entrance and exit presets, also usable as declarative effect classes.
RotateEffectExtensions on T
Adds RotateEffect related extensions to AnimateManager.
SaturateEffectExtensions on T
Adds SaturateEffect related extensions to AnimateManager.
ScaleEffectExtensions on T
Adds ScaleEffect related extensions to AnimateManager.
ShaderEffectExtensions on T
Adds ShaderEffect related extensions to AnimateManager.
ShakeEffectExtensions on T
Adds ShakeEffect related extensions to AnimateManager.
ShimmerEffectExtensions on T
Adds ShimmerEffect related extensions to AnimateManager.
SizeEffectExtensions on T
SlideEffectExtensions on T
Adds SlideEffect related extensions to AnimateManager.
SliverFadeEffectExtensions on T
Adds SliverFadeEffect to a sliver animation or a list of slivers.
SliverMoveEffectExtensions on T
Adds sliver painting translation to Animate or AnimateList.
SwapEffectExtensions on T
Adds SwapEffect related extensions to AnimateManager.
ThenEffectExtensions on T
Adds ThenEffect related extensions to AnimateManager.
TintEffectExtensions on T
Adds TintEffect related extensions to AnimateManager.
ToggleEffectExtensions on T
Adds ToggleEffect related extensions to AnimateManager.
VisibilityEffectExtensions on T
Adds VisibilityEffect related extensions to AnimateManager.

Typedefs

AnimateCallback = void Function(AnimationController controller)
Function signature for Animate callbacks.
AnimateInitCallback = dynamic Function(AnimationController controller)
Initialization callback that may return a bool to override automatic playback.
AnimatePresenceBuilder = Widget Function(BuildContext context, Animation<double> animation, Widget child)
Builds a presence transition with read-only progress from absent (0) to present (1). The animation instance stays the same for the widget's lifetime. Use transitions that listen to animation, or an AnimationAdapter to drive an Animate effect chain. The builder is not called for each animation tick.
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.
ShaderUpdateCallback = EdgeInsets? Function(ShaderUpdateDetails details)
Function signature for ShaderEffect update handlers.
ToggleEffectBuilder = Widget Function(BuildContext context, bool value, Widget child)