Skip to content

Releases: xvrh/lottie-flutter

v3.1.2

17 May 18:48
eeda2f4
Compare
Choose a tag to compare
  • Fixes for some animations generated by lottiefiles.com

v3.1.1

13 May 15:37
ba039e9
Compare
Choose a tag to compare
  • Fix rounding-off error on progress calculation
  • Allow missing end values for integer animations

v3.1.0

21 Feb 14:20
Compare
Choose a tag to compare
  • Use package:http for Lottie.network. This allows to drop dependency on dart:html and be compatible with wasm.
  • Fix new lints from Flutter 3.19

v3.0.0

11 Jan 14:09
Compare
Choose a tag to compare
  • Add support for layer blend mode

  • Allow to load Telegram Stickers (.tgs)

Lottie.asset(
  'sticker.tgs',
  decoder: LottieComposition.decodeGZip,
)
  • Add renderCache parameter.
Lottie.asset('assets/complex_animation.json',
  renderCache: RenderCache.raster,
)

Opt-in to a special render mode where the frames of the animation are lazily rendered and kept in a cache.
Subsequent runs of the animation are cheaper to render.

There are 2 kinds of caches:

RenderCache.raster: keep the frame rasterized in the cache (as [dart:ui.Image]).
Subsequent runs of the animation are very cheap for both the CPU and GPU but it takes
a lot of memory.
RenderCache.drawingCommands: keep the frame as a list of graphical operations ([dart:ui.Picture]).
Subsequent runs of the animation are cheaper for the CPU but not for the GPU.

  • Expose a hook to customize how to decode zip archives. This is useful for dotlottie archives (.lottie) when we want
    to specify a specific .json file inside the archive
Lottie.asset(
  'animation.lottie',
  decoder: customDecoder,
);

Future<LottieComposition?> customDecoder(List<int> bytes) {
  return LottieComposition.decodeZip(bytes, filePicker: (files) {
    return files.firstWhere((f) => f.name == 'animations/cat.json');
  });
}
  • Add backgroundLoading parameter to Lottie.asset|network|file|memory.
    If backgroundLoading is true, the animation will be loaded in a background isolate.
    This is useful for large animations that can take a long time to parse and block the UI work.

  • Remove the name property from LottieComposition

  • imageProviderFactory is not used in .zip file by default anymore.
    To restore the old behaviour, use:

Future<LottieComposition?> decoder(List<int> bytes) {
  return LottieComposition.decodeZip(bytes, imageProviderFactory: imageProviderFactory);
}

Lottie.asset('anim.json', decoder: decoder)
  • Disable gradient cache optimization when ValueDelegate.gradientColor is used
  • Use DefaultAssetBundle.of in AssetLottie before fallback to rootBundle
  • Add BuildContext optional parameter in LottieProvider.load
  • Fixed varying opacity stops across keyframes in the same gradient
  • Fixed rounded corners for non-closed curves
  • Implement auto-orient
  • Require Flutter 3.16

v3.0.0-alpha.4

22 Dec 17:22
08e9678
Compare
Choose a tag to compare
v3.0.0-alpha.4 Pre-release
Pre-release
  • Add backgroundLoading parameter to Lottie.asset|network|file|memory.
    If backgroundLoading is true, the animation will be loaded in a background isolate.
    This is useful for large animations that can take a long time to parse and block the UI work.

  • Replace enableRenderCache with renderCache: RenderCache.raster.
    The new class RenderCache allows to specify the cache behaviour:

    • RenderCache.raster: Cache the frames as rasterized images living in the GPU memory.
    • RenderCache.drawingCommands: Cache the frames as a list of graphical operations. This will only save CPU
      work but will use a lot less memory.

v3.0.0-alpha.3

25 Nov 14:26
c7066ca
Compare
Choose a tag to compare
v3.0.0-alpha.3 Pre-release
Pre-release
  • Reduce the max memory used when using enableRenderCache (now limited to 50MB)
  • Allow to configure the memory with a global settings:
Lottie.renderCacheMaxMemory = 75000000;

v3.0.0-alpha.2

22 Nov 08:44
faf7d74
Compare
Choose a tag to compare
v3.0.0-alpha.2 Pre-release
Pre-release
  • Implement auto-orient
  • Add support for layer blend mode
  • Require Flutter 3.16

v3.0.0-alpha.1

15 Nov 11:02
a2acfc7
Compare
Choose a tag to compare
v3.0.0-alpha.1 Pre-release
Pre-release
  • Add enableRenderCache parameter.
Lottie.asset('assets/complex_animation.json',
  enableRenderCache: true,
)

It allows to opt into a mode where the frames of the animation are rendered lazily in an offscreen cache.
Subsequent runs of the animation will be very cheap to render.

This is useful is the animation is complex and can consume a lot of energy from the battery.
It's a trade-off to lower the CPU usage at the cost of an increased memory usage.

The render cache is managed internally and will release the memory once the animation is disposed.
The cache is shared between all animations. If 2 Lottie widget are rendered at the same size, they will render only
once.

Any change in the configuration of the animation (delegates, frame rate etc...) will clear the cache.
Any change in the size will invalidate the cache. The cache use the final size visible on the screen (with all
transforms applied).

  • Allow to load Telegram Stickers (.tgs)
Lottie.asset(
  'sticker.tgs',
  decoder: LottieComposition.decodeGZip,
)
  • Expose a hook to customize how to decode zip archives. This is useful for dotlottie archives (.lottie) when we want
    to specify a specific .json file inside the archive
Lottie.asset(
  'animation.lottie',
  decoder: customDecoder,
);

Future<LottieComposition?> customDecoder(List<int> bytes) {
  return LottieComposition.decodeZip(bytes, filePicker: (files) {
    return files.firstWhere((f) => f.name == 'animations/cat.json');
  });
}
  • Remove the name property from LottieComposition
  • imageProviderFactory is not used in .zip file by default anymore.
    To restore the old behaviour, use:
Future<LottieComposition?> decoder(List<int> bytes) {
  return LottieComposition.decodeZip(bytes, imageProviderFactory: imageProviderFactory);
}

Lottie.asset('anim.json', imageProviderFactory: imageProviderFactory, decoder: decoder)
  • Disable gradient cache optimization when ValueDelegate.gradientColor is used
  • Use DefaultAssetBundle.of in AssetLottie before fallback to rootBundle
  • Add BuildContext optional parameter in LottieProvider.load
  • Fixed varying opacity stops across keyframes in the same gradient
  • Fixed rounded corners for non-closed curves

v2.7.0

20 Oct 13:59
9e9de6d
Compare
Choose a tag to compare
  • Support loading Fonts from a zip file
  • Fix a bug in Text with strokes
  • Fix gradient interpolation for opacity stops beyond the last color stop
  • Add color value callback to solid layer

v2.6.0

08 Aug 10:30
Compare
Choose a tag to compare
  • Accept List<int> instead of Uint8List in LottieComposition.fromBytes
  • Stroke line cap defaults to butt instead of square