Flutter SVG rendering

后端 未结 7 541
花落未央
花落未央 2020-12-03 02:27

I tried adding an image with a SVG source to my flutter application.

new AssetImage(\"assets/images/candle.svg\"))

But I didn\'t get any visual

相关标签:
7条回答
  • 2020-12-03 03:06

    You can use flare to create animations and just import .flr as an asset

    import 'package:flare_flutter/flare_actor.dart';
    class MyHomePage extends StatefulWidget {
      @override
      _MyHomePageState createState() => new _MyHomePageState();
    }
    
    class _MyHomePageState extends State<MyHomePage> {
      @override
      Widget build(BuildContext context) {
        return new FlareActor("assets/Filip.flr", alignment:Alignment.center, fit:BoxFit.contain, animation:"idle");
      }
    }
    

    visit flare_flutter https://pub.dev/packages/flare_flutter

    0 讨论(0)
提交回复
热议问题