How to use a flare flutter animation in flutter

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

1. Create Flare File Like this one: [https://www.2dimensions.com/a/nb312/files/flare/new-file-3](https://www.2dimensions.com/a/nb312/files/flare/new-file-3) 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: - assets/animation/font-size: 1rem;](sunny_rotate.flr``3. set packagein your pubspec.yaml file ,you should set : ``flare_flutter: ^1.0.2`` 4. Use in dart file``import 'package:flare_flutter/flare_actor.dart'; FlareActor( "assets/animation/sunny_rotate.flr", animation: "sunny_rotate", fit: BoxFit.contain, alignment: Alignment.topRight, )``It is easy,so let go to do it now. The whole project is here: [https://github.com/nb312/flutter_weather](https://github.com/nb312/flutter_weather)you can check out it and run yourself. Thanks.

Tags: flare flutter animation



0 Comments
Login to comment.
Recent Comments

Be the first to Comment. You can ask a Query or Share your toughts or Just say thanks.




© 2018 - Fluttercentral | Email to me - Seven.srikanth@gmail.com