animated_vector library

A library for animated vectors that can be defined in a declarative and composable way a la flutter

Classes

AnimatedSequence
A widget to play a sequence of AnimatedVectorData in a controlled manner. The widget uses a SequenceMachine under the hood.
AnimatedSequenceController
A controller passed to AnimatedSequence to control the execution flow of its sequence.
AnimatedVector
A widget that displays and animates an AnimatedVectorData instance. It's an approximate parallel to flutter's built-in AnimatedIcon.
AnimatedVectorData
Data for an animated vector, to use with widgets like AnimatedVector or inside a SequenceItem for AnimatedSequence.
AnimatedVectors
A collection of animated vectors that are available with the lib by default.
AnimationInterval
An interval of time that defines when an animation starts and when it end. Very similar to flutter Interval but instead of using normalized values it instead uses more human friendly Duration values. It is nonetheless possible to get normalized values with normalizeWithDuration.
AnimationProperties
Abstract base class for a group of properties that can be animated. Each subclass should be paired to a specific VectorElement subclass.
AnimationStep<T>
A step of an AnimationStepSequence. Needs a tween with at least one of begin or end to be non null. This step will be animated in the period of time defined by interval.
ClipPathAnimationProperties
An AnimationProperties subclass for ClipPathElement.
ClipPathElement
An element that applies a clip to other elements based on its pathData.
ConstColorTween
Specialized subclass of ConstTween for tweening between colors. It calls Color.lerp inside its transform method. Mirrors ColorTween from flutter.
ConstPathDataTween
Specialized subclass of ConstTween for tweening between path data. It calls PathData.lerp inside its transform method.
ConstTween<T>
A class that is very similar to flutter's Tween but has its fields immutable and the constructor is const. Was mainly created to allow for completely consts AnimatedVectorData instances.
GroupAnimationProperties
An AnimationProperties subclass for GroupElement.
GroupElement
The vector element that groups elements together.
PathAnimationProperties
An AnimationProperties subclass for PathElement.
PathCache
A cache for PathDataParse classes to avoid parsing and computing the svg path each time the operations array is requested.
PathClose
Represents a close path command. The path will draw a line between the last point and the last move to directive.
PathCommand
A command inside inside a PathData instance. Four types are available:
PathCurveTo
Represents an absolute cubic to path command. The cubic will use x1 and y1 as its first control point, x2 and y2 as its second control point and x3 and y3 as its end point. The first point of the curve is represented by the last drawn point.
PathData
A class that represents svg path data.
PathDataParse
A specialized instance of PathData that is able to build a list of PathCommand using the path data inside svg.
PathElement
A vector element that draws svg path data.
PathLineTo
Represents an absolute line to path command. The point to draw a line to is represented by its x and y coordinates. The first point of the line is represented by the last drawn point.
PathMoveTo
Represents an absolute move to path command. The point to move to is represented by its x and y coordinates.
RootVectorAnimationProperties
An AnimationProperties subclass for RootVectorElement.
RootVectorElement
The vector element that represents the root of a vector.
SequenceEntry
Represents an entry inside AnimatedSequence or SequenceMachine.
SequenceGroup
A subclass of SequenceEntry that treats multiple SequenceEntrys as a single one.
SequenceItem
Single item version of SequenceEntry.
SequenceMachine
An internal utility for the AnimatedSequence widget. It manages the state of a sequence and handles transitions and configurations.
ShapeShifterConverter
Utility class to interface with Shape Shifter.
ShapeShifterCurves
A collection of curves used by ShapeShifter. Mostly used by animated_vector_gen.
VectorElement<T extends AnimationProperties>
Base class for elements that lie inside AnimatedVectorData.root.

Enums

ExportAnimationFormat
The format to use when exporting an AnimatedVectorData. Currently the only two supported formats are gif and apng
PathCommandType
The type of a PathCommand. Used for compatibility checks between commands to interpolate paths.

Extensions

AnimatedVectorDataToAnimation on AnimatedVectorData
An extension over AnimatedVectorData to export it to an animated file format to allow display over other apps.

Typedefs

AnimationStepSequence<T> = List<AnimationStep<T>>
A sequence of AnimationStep of a specific type. Each entry should have an AnimationInterval that doesn't overlap with any other entries in the same sequence as that would throw an assertion. Used in AnimationProperties subclasses.
EvaluatedClipPathAnimationProperties = ({PathData? pathData})
Evaluated data for ClipPathAnimationProperties.
EvaluatedGroupAnimationProperties = ({double? pivotX, double? pivotY, double? rotation, double? scaleX, double? scaleY, double? translateX, double? translateY})
Evaluated data for GroupAnimationProperties.
EvaluatedPathAnimationProperties = ({double? fillAlpha, Color? fillColor, PathData? pathData, double? strokeAlpha, Color? strokeColor, double? strokeWidth, double? trimEnd, double? trimOffset, double? trimStart})
Evaluated data for PathAnimationProperties.
EvaluatedRootVectorAnimationProperties = ({double? alpha})
Evaluated data for RootVectorAnimationProperties.
PathCommands = List<PathCommand>
A list of commands to build a path. Refer to PathCommand for more info
VectorElements = List<VectorElement<AnimationProperties>>
A list of VectorElements. Used by RootVectorElement and GroupElement.

Exceptions / Errors

MissingPropertyException
Exception thrown when ShapeShifterConverter.toAVD needs a property to be found inside the json file but couldn't.
PathCommandsIncompatibleException
Thrown when two PathCommand don't match types between each other. Usually thrown by PathCommand.lerp
UnknownSequenceTagException
An exception thrown by AnimatedSequenceController.jumpTo when the specified tag can't be found inside the sequence referenced by its AnimatedSequence widget.
UnsupportedAnimationProperty
Exception thrown when ShapeShifterConverter.toAVD finds an animation property that refers to a property the lib was not built to handle.