33 Commits

Author SHA1 Message Date
08e9678dc3 Background loading & RenderCache.drawingCommands (#326) 2023-12-22 18:21:28 +01:00
a2acfc7bb9 Add enableRenderCache parameter (#317) 2023-11-15 10:50:11 +01:00
aef8ef7ee0 Fix bugs & support .tgs & .lottie (#314)
- Fixed varying opacity stops across keyframes in the same gradient
- Fixed rounded corners for non-closed curves
- Allow to load Telegram Stickers (.tgs)

```dart
Lottie.asset(
  'sticker.tgs',
  decoder: LottieComposition.decodeGZip,
)
```

- Expose a hook to customize how to decode zip archives. This is useful
for dotlottie (.lottie) archives when we want
to specify a specific .json file inside the archive

```dart
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 name property from `LottieComposition`
- `imageProviderFactory` is not used in .zip file by default anymore.
To restore the old behaviour, use:
```dart
Future<LottieComposition?> decoder(List<int> bytes) {
  return LottieComposition.decodeZip(bytes, imageProviderFactory: imageProviderFactory);
}

Lottie.asset('anim.json', imageProviderFactory: imageProviderFactory, decoder: decoder)
```
2023-11-08 09:10:25 +01:00
fdc4018f57 Add an example on how to cache animation as List<Image> (#282) 2023-06-02 13:45:22 +02:00
c32550cf15 Use AssetLottie in README.md (#261)
Update documentation to use `AssetLottie(...).load()` instead of
`LottieComposition.fromByteData(...)`

Resolves https://github.com/xvrh/lottie-flutter/issues/215
2023-01-27 22:42:31 +01:00
8dcb052fe1 Rework the cache so animation can be loaded without flickering 1 frame (#246)
Now, the cache can return a `SynchronousFuture` when the composition is
already available.
2022-12-14 14:06:34 +01:00
a333a42f01 Enable use_super_parameters lint (#242) 2022-11-10 14:14:28 +01:00
d8f5b872ef [feat] support image layer quality setting (#214) 2022-07-27 11:11:26 +02:00
bc3eb4621b Add latest feature/fixes from Lottie-Android (#209)
- Added support for rounded corners on shapes and rects
- Add support for text in dynamic properties (ValueDelegate)
- Improve stroke with offset
- Add support for reversed polystar paths
- Enforce order of operations to avoid rounding errors
2022-04-14 22:20:22 +02:00
b2ebd2058d Fix new lints in Flutter 2.10 (#196) 2022-02-14 09:31:30 +01:00
89c62122bf Add support for Blur & DropShadow (#170) 2021-09-19 20:48:01 +02:00
cb929e791d Remove more dependencies and add errorBuilder (#155) 2021-07-07 10:21:05 +02:00
50495f24e2 Add newest bug fixes from lottie-android (#154) 2021-06-25 14:41:43 +02:00
9471029b0a Move all tests to the root test folder (#147) 2021-05-05 13:17:13 +02:00
5b7fde198a Fix bounds calculation bug (#128) 2021-02-06 09:32:25 +01:00
2360f643b7 Migrate to null safety (#127) 2021-01-23 11:09:32 +01:00
ba0bfcd126 Fix crash when path.computeMetrics returns empty list (#116) 2020-12-12 22:41:38 +01:00
548c77dc45 Add FrameRate and improve performance (#93)
- Run the animation at the exported frame rate
- Wrap the animation in a RepaintBoundary
- Don't paint during "static" periods
2020-08-04 22:02:02 +02:00
0715f6a402 Export the Marker class (#63)
And add an example to play the animation between 2 markers
2020-05-19 22:22:27 +02:00
8f4952a23a Simplify AnimationController example (#50) 2020-04-18 22:54:31 +02:00
8bad4f96c0 Add an other example for animation controller (#49) 2020-04-17 21:47:07 +02:00
bb73626c46 Add golden test for all animations (#44)
And:

Improve "save_frames" example
Export AssetLottie, NetworkLottie etc..
2020-04-11 15:25:13 +02:00
47e47f5cb8 Add examples (#43)
- How to run the animation between 2 specifics frames
- How to export the animation to a file
2020-04-09 23:04:07 +02:00
954ec05598 Add alert dialog example (#39) 2020-04-03 23:20:22 +02:00
66e644d043 Prepare version 0.3.3 (#37) 2020-04-03 13:27:13 +02:00
af9b69326a Dash path effect (#27) 2020-03-12 23:16:41 +01:00
2914caf220 Add example for hide after complete 2020-03-02 22:18:52 +01:00
e89c3c4914 Expose LottieDelegates to modify animation properties at runtime (#23) 2020-03-02 22:11:38 +01:00
fc683482db Add an example to run an animation once (#21) 2020-02-26 23:00:28 +01:00
a63b752ccc Setup basic image comparison tests (#6) 2020-02-03 23:43:24 +01:00
be0a3bbdad Support loading a zip file (#5) 2020-02-02 22:12:04 +01:00
7cc0bcf5b3 Text layer & images support (#4) 2020-02-02 21:26:53 +01:00
d42f6b4b68 Support Polystar shape and re-organise examples (#2) 2020-02-01 16:10:41 +01:00