File tree Expand file tree Collapse file tree 4 files changed +36
-10
lines changed Expand file tree Collapse file tree 4 files changed +36
-10
lines changed Original file line number Diff line number Diff line change 1+ ## [ 1.5.12] - 2019-10-04 17:56:54
2+
3+ - Introduce FlareTesting.setup(); call this prior to running any tests using Flare content.
4+
15## [ 1.5.11] - 2019-10-04 13:44:04
26
37- Clamping trim start/end values to 0-1.
Original file line number Diff line number Diff line change @@ -11,21 +11,34 @@ class FlareCacheAsset extends CacheAsset {
1111 FlutterActor _actor;
1212 FlutterActor get actor => _actor;
1313
14+ static bool useCompute = true ;
15+
16+ void loadedActor (FlutterActor actor, String filename) {
17+ actor.loadImages ().then ((_) {
18+ if (actor != null ) {
19+ _actor = actor;
20+ completeLoad ();
21+ } else {
22+ print ("Failed to load flare file from $filename ." );
23+ }
24+ });
25+ }
26+
1427 @override
1528 void load (Cache cache, String filename) {
1629 super .load (cache, filename);
1730 if (cache is AssetBundleCache ) {
1831 cache.bundle.load (filename).then ((ByteData data) {
19- compute ( FlutterActor .loadFromByteData, data). then (( FlutterActor actor ) {
20- actor. loadImages (). then ((_) {
21- if (actor != null ) {
22- _actor = actor;
23- completeLoad ( );
24- } else {
25- print ( "Failed to load flare file from $ filename ." );
26- }
32+ if (useCompute ) {
33+ compute ( FlutterActor .loadFromByteData, data)
34+ . then (( FlutterActor actor ) {
35+ loadedActor ( actor, filename) ;
36+ } );
37+ } else {
38+ FlutterActor . loadFromByteData (data). then (( FlutterActor actor) {
39+ loadedActor (actor, filename);
2740 });
28- });
41+ }
2942 });
3043 }
3144 }
Original file line number Diff line number Diff line change 1+ import 'flare_cache.dart' ;
2+ import 'flare_cache_asset.dart' ;
3+
4+ class FlareTesting {
5+ static void setup () {
6+ FlareCache .doesPrune = false ;
7+ FlareCacheAsset .useCompute = false ;
8+ }
9+ }
Original file line number Diff line number Diff line change 11name : flare_flutter
22description : Vector design and runtime animation for Flutter.
3- version : 1.5.11
3+ version : 1.5.12
44author : " 2Dimensions Team <info@2dimensions.com>"
55homepage : https://github.com/2d-inc/Flare-Flutter
66environment :
You can’t perform that action at this time.
0 commit comments