svgaplayer_flutter 1.0.1

SVGAPlayer-Flutter #


Introduce #

SVGAPlayer is a light-weight animation renderer. You use tools to export svga file from Adobe Animate CC or Adobe After Effects, and then use SVGAPlayer to render animation on mobile application.

SVGAPlayer-Flutter render animation natively via Flutter CustomPainter, brings you a high-performance, low-cost animation experience.

If wonder more information, go to this website.

  • SVGAPlayer-Flutter supports 2.0 format only.

Usage #

Here introduce SVGAPlayer-Flutter usage. Wonder exporting usage? Click here.

Add dependency #

  svgaplayer_flutter: ^0.0.1  #latest version

Locate files #

SVGAPlayer could load svga file from Flutter local assets directory or remote server. Add file to pubspec.yaml by yourself.

Super simple to use #

The simplest way to render an animation is to use SVGASimpleImage component.

class MyWidget extends Widget {

  Widget build(BuildContext context) {
    return Container(
      child: SVGASimpleImage(
          resUrl: ""),


Animation will run repeatedly. If you wondering a stronger animation controls, use code.

Code to use #

To control an animation rendering, you need to create a SVGAAnimationController instance just like Flutter regular animation. Assign to SVGAImage, load and decode resource using SVGAParser, and then do things as you want with SVGAAnimationController.

import 'package:flutter/material.dart';
import 'package:svgaplayer_flutter/svgaplayer_flutter.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  _MyAppState createState() => _MyAppState();

class _MyAppState extends State<MyApp> with SingleTickerProviderStateMixin {
  SVGAAnimationController animationController;

  void initState() {
    this.animationController = SVGAAnimationController(vsync: this);

  void dispose() {

  void loadAnimation() async {
    final videoItem = await SVGAParser.shared.decodeFromURL(
    this.animationController.videoItem = videoItem;
        .repeat() // Try to use .forward() .reverse()
        .whenComplete(() => this.animationController.videoItem = null);

  Widget build(BuildContext context) {
    return Container(
      child: SVGAImage(this.animationController),

Cache #

We will not manage any caches, you need to use dio or other libraries to handle resource caches.

Use SVGAParser.decodeFromBytes method to decode caching data.

Features #

Here are many feature samples.

License #


Anti 996

1.0.1 (2019-11-27) #

  • Fix an issue about setText.

1.0.0 (2019-11-19) #

  • Use protobuf ^1.0.0

0.1.1 (2019-09-12) #

Chores #
  • Lock protobuf version < 0.13.16, because 0.13.16 leads build fail.

0.1.0 (2019-07-26) #

Feat #
  • Add file option to SVGASimpleImage.

0.0.4 (2019-07-01) #

Bug Fixes #
  • Should not draw as groups for bitmap or shape, should draw as a sprite one by one.

0.0.3 (2019-07-01) #

Chores #
  • upgrade to 0.0.3 (3c40d8bf)
  • 0.0.2 released. (7a54b493)
Bug Fixes #

0.0.1 (2019-04-01) #

New Features #
  • Add zh readme. (ed4ceaf8)
  • Add assets to SVGASimpleImage. (34ffe14d)
  • Add decodeFromAssets method to parser. (e2746e62)
  • Add dynamicText dynamicHidden and dynamicDrawer. (0a0f7201)
  • Add SVGASimpleImage. (f6add286)
  • Add static url method to create Widget. (516d356b)
  • Add callbacks. (4fce439d)
  • Add path cache. fix: Miss shape transform. (f8104fb7)
  • Add shape render. (0c75cc32)
  • Add Parser, Player and Bitmap render. (99a1be72)
Other Changes #
  • Update samples and doc. (a5d78c51)
Refactors #
  • use AnimationController base animation. (ac210165)


svgaplayer_flutter_example #

Demonstrates how to use the svgaplayer_flutter plugin.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  svgaplayer_flutter: ^1.0.1

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:svgaplayer_flutter/svgaplayer_flutter.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Feb 19, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5
  • Flutter: 1.12.13+hotfix.7

Health suggestions

Fix lib/proto/svga.pb.dart. (-0.50 points)

Analysis of lib/proto/svga.pb.dart reported 1 hint:

line 855 col 21: The value of the field '_shapes' isn't used.

Format lib/parser.dart.

Run flutter format to format lib/parser.dart.

Format lib/player.dart.

Run flutter format to format lib/player.dart.

Fix additional 4 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/proto/svga.pbenum.dart (Run flutter format to format lib/proto/svga.pbenum.dart.)
  • lib/proto/svga.pbjson.dart (Run flutter format to format lib/proto/svga.pbjson.dart.)
  • lib/proto/svga.pbserver.dart (Run flutter format to format lib/proto/svga.pbserver.dart.)
  • lib/svgaplayer_flutter.dart (Run flutter format to format lib/svgaplayer_flutter.dart.)


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
http ^0.12.0+1 0.12.0+4
path_drawing ^0.4.0 0.4.1
protobuf ^1.0.0 1.0.1
Transitive dependencies
async 2.4.0
charcode 1.1.3
collection 1.14.11 1.14.12
fixnum 0.10.11
http_parser 3.1.3
meta 1.1.8
path 1.6.4
path_parsing 0.1.4
pedantic 1.9.0
sky_engine 0.0.99
source_span 1.6.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies