diff --git a/flare_flutter/CHANGELOG.md b/flare_flutter/CHANGELOG.md index 08f6de5..291c2f8 100644 --- a/flare_flutter/CHANGELOG.md +++ b/flare_flutter/CHANGELOG.md @@ -1,3 +1,8 @@ +## [1.7.1] - 2019-11-07 15:03:39 + +- Backing out changeImageFromNetwork until new PaintingBinding.instance.instantiateImageCodec signature lands in stable. +- You can manually implement this function if you need it. Example here: https://gist.github.com/luigi-rosso/c50277341bd2681be072a575acbeb1fc#file-dynamic_image_swapping-dart-L60 + ## [1.7.0] - 2019-11-07 12:16:35 - Adding support for runtime image swapping. diff --git a/flare_flutter/lib/flare.dart b/flare_flutter/lib/flare.dart index a629c0b..7222ff6 100644 --- a/flare_flutter/lib/flare.dart +++ b/flare_flutter/lib/flare.dart @@ -1100,22 +1100,24 @@ class FlutterActorImage extends ActorImage with FlutterActorDrawable { /// Change the image for this node via a network url. /// Returns true when successful. - Future changeImageFromNetwork(String url) async { - var networkImage = NetworkImage(url); - var val = await networkImage.obtainKey(const ImageConfiguration()); - var load = networkImage.load(val, (Uint8List bytes, - {int cacheWidth, int cacheHeight}) { - return PaintingBinding.instance.instantiateImageCodec(bytes, - cacheWidth: cacheWidth, cacheHeight: cacheHeight); - }); - - final completer = Completer(); - load.addListener(ImageStreamListener((ImageInfo info, bool syncCall) { - changeImage(info.image); - completer.complete(true); - })); - return completer.future; - } + /// TODO: re-enable this when the changes to instantiateImageCodec + /// land in stable. +// Future changeImageFromNetwork(String url) async { +// var networkImage = NetworkImage(url); +// var val = await networkImage.obtainKey(const ImageConfiguration()); +// var load = networkImage.load(val, (Uint8List bytes, +// {int cacheWidth, int cacheHeight}) { +// return PaintingBinding.instance.instantiateImageCodec(bytes, +// cacheWidth: cacheWidth, cacheHeight: cacheHeight); +// }); + +// final completer = Completer(); +// load.addListener(ImageStreamListener((ImageInfo info, bool syncCall) { +// changeImage(info.image); +// completer.complete(true); +// })); +// return completer.future; +// } /// Change the image for this node with one in an asset bundle. /// Returns true when successful. diff --git a/flare_flutter/pubspec.yaml b/flare_flutter/pubspec.yaml index 4e50caf..7aa9b62 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.7.0 +version: 1.7.1 author: "2Dimensions Team " homepage: https://github.com/2d-inc/Flare-Flutter environment: