flutter_svga_easyplayer library
Play SVGA animations in Flutter: one widget for the common case, a controller for full control, with disk and memory caching, precaching and typed errors.
Classes
- AudioEntity
- A sound embedded in an SVGA animation and the frame range it covers.
- FrameEntity
- What one sprite looks like on one frame.
- MovieEntity
-
A decoded SVGA animation, ready to hand to an
SVGAAnimationController. - MovieParams
- Canvas size and timing of an SVGA animation.
- ShapeEntity
- One vector shape drawn by a sprite on a given frame.
- SpriteEntity
- A layer of the animation: one bitmap and/or set of shapes, with its state on every frame.
- SVGAAnimationController
- Drives playback of one MovieEntity.
- SVGACache
- Persistent on-disk cache of downloaded SVGA files.
- SVGADynamicEntity
- Runtime replacements for the layers of one decoded animation.
- SVGAEasyPlayer
- Loads and plays an SVGA animation from a URL or an asset.
- SVGAImage
- Paints the current frame of an SVGAAnimationController.
- SVGAMemoryCache
- Keeps decoded animations in memory so that several widgets showing the same file share one set of bitmaps, and so that reopening a screen does not decode the file again.
- SVGAParser
- Loads SVGA animations from the network, the asset bundle or memory.
- SVGAPrecacheManager
- Downloads SVGA files into SVGACache ahead of time, so the first playback of each one starts without waiting for the network.
- SVGAPrecacheResult
- Outcome of a precache batch.
- SVGAShapeStyle
-
Fill and stroke of a ShapeEntity. Colour channels are in
0.0–1.0. - SVGATransform
-
A 2D affine transform:
[a c tx; b d ty; 0 0 1]. - SVGAVectorPath
- A vector outline from an SVGA file, compiled once and replayed on demand.
Typedefs
- SVGACustomDrawer = void Function(Canvas canvas, int frameIndex)
- Draws extra content on top of a sprite. Called once per painted frame with the canvas already transformed into the sprite's coordinate space.
- SVGAErrorCallback = void Function(Object error, StackTrace stackTrace)
- Called when an animation fails to load.
- SVGAErrorWidgetBuilder = Widget Function(BuildContext context, Object error)
- Builds the widget shown in place of an animation that failed to load.
- SVGAPrecacheProgress = void Function(int completed, int total, String source, bool success)
- Called each time one entry of a precache batch finishes.
Exceptions / Errors
- SVGAAssetException
- A bundled asset could not be read.
- SVGAException
- Base type for every failure this package reports.
- SVGAFormatException
- The bytes are not a valid SVGA 2.x file: wrong container, truncated, or corrupt.
- SVGANetworkException
- The request could not be completed, or the server answered with a non-success status.
- SVGATimeoutException
- The request did not finish within the allowed time.