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: