Search packages, repositories and app categories

Package detailsv2.1.0

animated_svg

Flutter package for displaying and animating Scalable Vector Graphics 1.1 files.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
978
Likes
113
Pub points
160

Install package

flutter pub add animated_svg

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Animated SVG is a Flutter package that enables the display and animation of Scalable Vector Graphics (SVG) files in Flutter applications. It supports SVG 1.1 format and allows developers to render vector graphics with smooth animations across multiple platforms. The package integrates seamlessly into Flutter projects, offering a lightweight solution for dynamic, resolution-independent visuals. It is particularly useful for creating interactive UI elements, loading indicators, or animated illustrations. With support for Android, iOS, Web, macOS, Windows, and Linux, it ensures consistent rendering across devices.

Use cases

  • Creating animated loading indicators
  • Rendering scalable icons with motion
  • Building interactive UI illustrations
  • Displaying animated logos
  • Enhancing app onboarding experiences

Key features

  • Supports SVG 1.1 format
  • Smooth animation playback
  • Cross-platform compatibility
  • Lightweight and efficient
  • Easy integration with Flutter
  • Dynamic SVG rendering

Suitable for

  • App developers needing vector animations
  • Designers integrating SVG assets
  • Projects requiring scalable UI elements
  • Interactive mobile and web apps
  • UI-heavy applications with visual storytelling

Considerations

  • Limited to SVG 1.1 (no SMIL or advanced features)
  • Performance may vary with complex SVGs
  • Requires proper SVG file optimization
  • Not suitable for highly dynamic or script-based SVGs
  • Animation control requires manual setup for advanced use cases

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Animated SVG | Flutter Package

Flutter package for displaying and animating Scalable Vector Graphics 1.1 files. The package has been written solely in Dart language.

animated_svg coverage style: very good analysis License: MIT

animated_svg_first_gif animated_svg_second_gif

Features

A powerful and fully customizable widget. With this package, you can animate SVGs without effort and make your UI look more lovely.

The AnimatedSvg widget creates a smooth transition between the two SVGs you assign.

   

Getting started

Let's take a look at how to implement AnimatedSvg to quickly create cool transition animation between SVGs.

First, add the following line to pubspec.yaml:

animated_svg: ^2.1.0

Second, import AnimatedSvg:

import 'package:animated_svg/animated_svg.dart';

Usage

Basic usage example:

main.dart

// Define an SvgController
late final SvgController controller;

@override
void initState() {
    // Initialize SvgController
    controller = AnimatedSvgController();
    super.initState();
}

@override
void dispose() {
    // Dispose SvgController
    controller.dispose();
    super.dispose();
}

@override
Widget build(BuildContext context) {
    // Call the AnimatedSvg widget anywhere in your widget tree.
    return AnimatedSvg(
        controller: controller,
        duration: const Duration(milliseconds: 600),
        onTap: () {},
        size: 80,
        clockwise: false,
        isActive: true,
        children: [
            SvgPicture.asset(
                'assets/play.svg',
            ),
            SvgPicture.asset(
                'assets/pause.svg',
            ),
        ],
    );
}

Example

More examples can be found in /example folder on GitHub.

Media Player - an example of basic implementation of AnimatedSvg. Simple project that simulates a media player. As usual, the player needs play and pause buttons. Thanks to the AnimatedSvg package, it is so easy to create a smooth transition between play and pause SVGs.

Additional information

This package has been written solely in Dart Language yet it has the flutter_svg as a dependency.

For more information please visit GitHub.

Feature requests and bugs

Please file feature requests and bugs at the issue tracker.

Maintainers

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package

No data available yet.