svga_wrapper 1.0.0 copy "svga_wrapper: ^1.0.0" to clipboard
svga_wrapper: ^1.0.0 copied to clipboard

A wrapper based on svgaplayer_3 that extends SVGASimpleImage with memory buffer support for SVGA animations.

example/svga_wrapper_example.dart

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

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'SVGA Wrapper Example',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('SVGA Wrapper Example'),
      ),
      body: const Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Text(
              'SVGA Animation Example',
              style: TextStyle(fontSize: 24),
            ),
            SizedBox(height: 20),
            // 使用 assets 中的 SVGA 文件
            SVGASimpleImageEx(
              assetsName: 'assets/animations/example.svga',
            ),
            SizedBox(height: 20),
            // 使用网络 URL
            SVGASimpleImageEx(
              resUrl: 'https://example.com/animation.svga',
            ),
          ],
        ),
      ),
    );
  }
}
0
likes
160
points
2
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A wrapper based on svgaplayer_3 that extends SVGASimpleImage with memory buffer support for SVGA animations.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, svgaplayer_3

More

Packages that depend on svga_wrapper