搜索分类、插件与代码仓

GitHub 代码仓BBarisKilic/Animated-SVG

Animated-SVG

用于显示和动画化可缩放矢量图形 1.1 文件的 Flutter 包。该包完全使用 Dart 语言编写。

Animated-SVG 项目封面
星标
18
复刻
5
最近推送(UTC)
2026年9月7日
项目状态
未归档

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

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

Bulent Baris Kilic GitHub avatar
GitHub 作者

Bulent Baris Kilic ↗

Dentist | Software Developer

@BBKDevelopmentGermany官方网站 ↗
语言DartSwiftKotlinObjective-C

分类

此仓库发布的插件

使用的依赖

依赖清单 6 项

如何选择适合项目的代码仓?

先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。

  1. 通过仓库名、作者或描述搜索,再按技术分类缩小范围。
  2. 结合星标、复刻与最近推送比较项目;星标反映社区关注,不代表质量保证。
  3. 使用前在 GitHub 核对 README、许可证与 Issues。

来源与维护

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗