How to use a flare flutter animation in flutter

This Article is posted by niebin312 at 12/11/2018 3:12:49 PM



<ol> <li>Create Flare File Like this one: <a href="https://www.2dimensions.com/a/nb312/files/flare/new-file-3">https://www.2dimensions.com/a/nb312/files/flare/new-file-3</a> and then export with *.flr file, my file is named 'sunny_rotate.flr' 2. Set the asset pathin your pubspec.yaml file, you could set like this. assets: <ul> <li>assets/animation/font-size: 1rem;](sunny_rotate.flr<code>3. set packagein your pubspec.yaml file ,you should set : </code>flare_flutter: ^1.0.2</li> </ul> </li> <li>Use in dart file<code>import 'package:flare_flutter/flare_actor.dart'; FlareActor( "assets/animation/sunny_rotate.flr", animation: "sunny_rotate", fit: BoxFit.contain, alignment: Alignment.topRight, )</code>It is easy,so let go to do it now.</li> </ol> <p>The whole project is here: <a href="https://github.com/nb312/flutter_weather">https://github.com/nb312/flutter_weather</a>you can check out it and run yourself. Thanks.</p>


Tags: flare flutter animation








0 Comments
Login to comment.
Recent Comments