From ee997b7233a621f934f2bac8cc73cf9923126180 Mon Sep 17 00:00:00 2001 From: Luigi Rosso Date: Wed, 6 Nov 2019 17:32:55 -0800 Subject: [PATCH] Squashed commit of the following: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 53a7c659b772f5b9442f569be0a389512a77ff29 Author: Luigi Rosso Date: Wed Nov 6 17:30:42 2019 -0800 Updating flare_flutter version. commit b391dd4343b710fa575b45c47d11aca8b3cb4b52 Merge: 1e9b22e 9ec074b Author: Luigi Rosso Date: Wed Nov 6 17:28:34 2019 -0800 Merge branch 'warmth_fix' commit 9ec074be6328914ebcd82e5285c9aef9e408e1d5 Author: Luigi Rosso Date: Wed Nov 6 15:43:31 2019 -0800 Call setState if mounted. commit c66ac647efac650ef38b425fa7488343e36a075f Author: Luigi Rosso Date: Wed Nov 6 15:38:06 2019 -0800 Addressing an issue found in #177 with FlareCacheBuilder setting state when widget is no longer mounted. commit 1e9b22e0aa12e27c362fcaf28d914aa482198db9 Author: Umberto Sonnino Date: Wed Nov 6 19:02:25 2019 +0100 Init mat before inverting commit bc07b8752c05bd1a05cfcded0c2193e23602a1e0 Author: Umberto Sonnino Date: Wed Nov 6 19:00:13 2019 +0100 Remove local flare_dart from examples pubspec #184 commit e1cca7cdc97bdfb1fd19d2ee365ce901c1e8339a Author: Luigi Rosso Date: Tue Oct 29 12:50:30 2019 -0700 Bumping versions, merging optimal_load branch, and persisting settings in checkbox example. commit 55cae393bb92dcd7157a5b12c55074e3bafa6d6d Author: Luigi Rosso Date: Tue Oct 29 12:41:43 2019 -0700 Copy transform affects stroke properly when instancing shapes. commit 43716dd3449266fe9f6f42c5bf05701d0bb06b88 Author: Luigi Rosso Date: Mon Oct 28 12:52:09 2019 -0700 Prevent coldLoad (async) from happening when widget isn’t ready to load. commit 506837e0bafff3060318bc65d03296ebb599f284 Author: Luigi Rosso Date: Fri Oct 25 13:00:56 2019 -0700 Improving loading. commit 9ee95b964dde6ee3fb17b9e969ab00b3d0992c9f Author: Luigi Rosso Date: Fri Oct 25 10:42:42 2019 -0700 Make sure overrideColor is set even when drawableNodes is null. commit 7d59de1e77c040acc271bc3981a70517856a31b1 Author: Umberto Sonnino Date: Fri Oct 25 13:15:34 2019 +0100 Move null check commit 528af53a2bc9ac68d00fc30aadb2f78509fff922 Author: Umberto Sonnino Date: Fri Oct 25 13:10:17 2019 +0100 Insert null checks for artboards with no drawables #178 commit 33f23a7d29b5adf04f5b6536ddaf74f1aa590165 Author: Umberto Sonnino Date: Fri Oct 25 12:16:16 2019 +0100 Remove GradientColor override of ActorPaint opacity getter #179 commit 59ba2f08174b43c7a7f8a7ff97cd04d533da1eea Author: Umberto Sonnino Date: Thu Oct 24 09:31:41 2019 +0100 Document the `actor_animatino.apply()` function commit d77438f87f7aae2d850a8295ae4d9a5b33505694 Author: Umberto Sonnino Date: Thu Oct 24 09:31:10 2019 +0100 Fix division by 0 on transform constraint commit f0cf988bc3ef928b8b96ae217133ecadca02b418 Author: Luigi Rosso Date: Fri Oct 11 12:59:13 2019 -0700 Fix reading of JSON clip values. Issue #172 commit a7796e0d6e9b5ea6957eafc9f784ba4c36320967 Author: Luigi Rosso Date: Fri Oct 11 12:39:48 2019 -0700 Mitigating issue #172. commit 373c14a4f3b2360c4252a8ac834c23bb28068f6e Author: Luigi Rosso Date: Wed Oct 9 14:21:47 2019 -0700 Fixing issue with image clipping. commit ae1c901441306953f09549b4c3bdd4612cc86af4 Author: Luigi Rosso Date: Wed Oct 9 11:19:16 2019 -0700 Fix merge bugs. commit d8cb780a543fe9fd35d60bcfcb198b70622c524f Author: Luigi Rosso Date: Wed Oct 9 11:09:42 2019 -0700 Adding support for difference clipping. commit bf99a765746f321937315e7ecd96aaa190a3d20b Author: Luigi Rosso Date: Tue Oct 8 19:07:26 2019 -0700 Matching stable version commit 9becc744d0d50f10533e3ad1f7c0b4daee6604c2 Author: Luigi Rosso Date: Tue Oct 8 13:58:11 2019 -0700 Bumping flare_dart to 2.0 due to breaking changes. commit 0a292cc67ea8d261057b9f9e5c32028e3436436c Author: Luigi Rosso Date: Tue Oct 8 13:39:57 2019 -0700 Bumping versions and changelogs. commit 431a98e4804efe6d073a9b55a9ce1a5f23c7ca4d Author: Luigi Rosso Date: Tue Oct 8 13:35:26 2019 -0700 Fixing up analysis issues for #169 commit 72fb6fc743ed3a241c7c51e5a8ebc90836f734ba Merge: 4d00202 dc68dea Author: Luigi Rosso Date: Tue Oct 8 13:02:17 2019 -0700 Merge branch 'master' of https://github.com/2d-inc/Flare-Flutter commit 4d00202a4f24b2c3d581b28cb15b953ec91c9f3c Author: Luigi Rosso Date: Tue Oct 8 13:02:11 2019 -0700 Cleaning up analysis issues. commit dc68dea6d57cb504d1a867c7e4c5b6768ec5dfe2 Merge: 5ca8d49 f1d9749 Author: Luigi Rosso Date: Tue Oct 8 11:06:53 2019 -0700 Merge pull request #168 from mehmetf/master Escalate the severity of unused imports in analyzer commit f1d97496a2679f470202f17298cd76a0411d7a8c Author: Mehmet Fidanboylu Date: Tue Oct 8 10:20:58 2019 -0700 Do the same changes to flare_dart commit 64f395edf7c6f8419a7a461e46664ff3723cfa78 Author: Mehmet Fidanboylu Date: Tue Oct 8 10:17:51 2019 -0700 Escalate the severity of unused imports in analyzer commit 5ca8d49c09406d1ac62ffffd4d0c5082744be7a3 Author: Luigi Rosso Date: Mon Oct 7 11:22:38 2019 -0700 Bumping versions and changelog. commit 874ce8e0b77a8ffc3eea9027cb31e2b75437da01 Author: Luigi Rosso Date: Mon Oct 7 11:20:28 2019 -0700 Adding support for nodes inside of shapes. commit 4d06431f341b426dd5cc41529a49c115e6354c51 Author: Luigi Rosso Date: Fri Oct 4 18:06:09 2019 -0700 Introducing FlareTesting.setup(); commit 2c5f4200535d679fd3092d1b6aa15ff71d85b869 Author: Luigi Rosso Date: Fri Oct 4 13:44:25 2019 -0700 Clamping trim start/end. commit daba34d11233391e7277b157bc117b8bbb626982 Author: Luigi Rosso Date: Mon Sep 30 21:21:55 2019 +0200 Cherry picking critical lints from #1 63 and updating for pub. --- example/favorite/pubspec.yaml | 2 -- example/penguin_dance/pubspec.yaml | 2 -- example/slider/pubspec.yaml | 2 -- example/space_reload/pubspec.yaml | 2 -- flare_dart/lib/actor_path.dart | 1 + flare_flutter/CHANGELOG.md | 4 +++ flare_flutter/lib/flare_cache_builder.dart | 29 ++++++++++++++-------- flare_flutter/pubspec.yaml | 2 +- 8 files changed, 25 insertions(+), 19 deletions(-) diff --git a/example/favorite/pubspec.yaml b/example/favorite/pubspec.yaml index b6dd8c4..7312210 100644 --- a/example/favorite/pubspec.yaml +++ b/example/favorite/pubspec.yaml @@ -11,8 +11,6 @@ dependencies: sdk: flutter flare_flutter: path: ../../flare_flutter - flare_dart: - path: ../../flare_dart cupertino_icons: ^0.1.2 dev_dependencies: diff --git a/example/penguin_dance/pubspec.yaml b/example/penguin_dance/pubspec.yaml index 0d9d8d3..d3288da 100644 --- a/example/penguin_dance/pubspec.yaml +++ b/example/penguin_dance/pubspec.yaml @@ -11,8 +11,6 @@ dependencies: sdk: flutter flare_flutter: path: ../../flare_flutter - flare_dart: - path: ../../flare_dart cupertino_icons: ^0.1.2 diff --git a/example/slider/pubspec.yaml b/example/slider/pubspec.yaml index ae3d4a9..f0637e8 100644 --- a/example/slider/pubspec.yaml +++ b/example/slider/pubspec.yaml @@ -11,8 +11,6 @@ dependencies: sdk: flutter flare_flutter: path: ../../flare_flutter - flare_dart: - path: ../../flare_dart cupertino_icons: ^0.1.2 dev_dependencies: diff --git a/example/space_reload/pubspec.yaml b/example/space_reload/pubspec.yaml index 21e3905..05373b8 100644 --- a/example/space_reload/pubspec.yaml +++ b/example/space_reload/pubspec.yaml @@ -17,8 +17,6 @@ dependencies: sdk: flutter flare_flutter: path: ../../flare_flutter -# flare_dart: -# path: ../../flare_dart # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. diff --git a/flare_dart/lib/actor_path.dart b/flare_dart/lib/actor_path.dart index 8c795ca..0017e8d 100644 --- a/flare_dart/lib/actor_path.dart +++ b/flare_dart/lib/actor_path.dart @@ -46,6 +46,7 @@ abstract class ActorBasePath { localTransform = Mat2D(); Mat2D.invert(localTransform, parent.worldTransform); } else if (!_isRootPath) { + localTransform = Mat2D(); // Path isn't root, so get transform in shape space. if (Mat2D.invert(localTransform, shape.worldTransform)) { Mat2D.multiply(localTransform, localTransform, worldTransform); diff --git a/flare_flutter/CHANGELOG.md b/flare_flutter/CHANGELOG.md index ead22b8..f518ac0 100644 --- a/flare_flutter/CHANGELOG.md +++ b/flare_flutter/CHANGELOG.md @@ -1,3 +1,7 @@ +## [1.6.5] - 2019-11-06 17:29:43 + +- Fixed an issue with FlareCacheBuilder calling setState when the widget is no longer mounted. + ## [1.6.4] - 2019-10-29 12:45:05 - Use latest flare_dart, fixing issue with transformAffectsStroke in instances. diff --git a/flare_flutter/lib/flare_cache_builder.dart b/flare_flutter/lib/flare_cache_builder.dart index dd8087f..5246e48 100644 --- a/flare_flutter/lib/flare_cache_builder.dart +++ b/flare_flutter/lib/flare_cache_builder.dart @@ -17,7 +17,19 @@ class FlareCacheBuilder extends StatefulWidget { } class _FlareCacheBuilderState extends State { - bool isWarm = false; + bool _isWarm = false; + bool get isWarm => _isWarm; + set isWarm(bool value) { + if (value == _isWarm) { + return; + } + if (mounted) { + setState(() { + _isWarm = value; + }); + } + } + final Set _assets = {}; @override void initState() { @@ -62,24 +74,21 @@ class _FlareCacheBuilderState extends State { } bool _updateWarmth() { + if (!mounted) { + return true; + } var filenames = widget.filenames; if (filenames == null) { - setState(() { - isWarm = true; - }); + isWarm = true; return true; } for (final filename in filenames) { if (getWarmActor(bundle, filename) == null) { - setState(() { - isWarm = false; - }); + isWarm = false; return false; } } - setState(() { - isWarm = true; - }); + isWarm = true; return true; } diff --git a/flare_flutter/pubspec.yaml b/flare_flutter/pubspec.yaml index a8b5455..cd3b0b9 100644 --- a/flare_flutter/pubspec.yaml +++ b/flare_flutter/pubspec.yaml @@ -1,6 +1,6 @@ name: flare_flutter description: Vector design and runtime animation for Flutter. -version: 1.6.4 +version: 1.6.5 author: "2Dimensions Team " homepage: https://github.com/2d-inc/Flare-Flutter environment: