98 Commits

Author SHA1 Message Date
5e71dabfa3 Bump version to 3.3.1 (#394) 2025-01-10 10:55:28 +01:00
f892a14a7e Upgrade package:archive ^4.0.0 (#392) 2024-12-16 22:08:00 +01:00
61756b6613 Flutter 3.27 (#389) 2024-12-12 17:28:06 +01:00
7e4d1d3813 Add conditional imports to prevent importing dart:io on Web targets (#387) 2024-12-10 10:11:07 +01:00
d0deffa2ee Apply blend mode at the layer level (#386) 2024-12-08 14:55:59 +01:00
eeda2f4de4 Fix expected int (#351)
Fixes #348
2024-05-17 20:41:58 +02:00
ba039e9423 Allow missing end values for integer animations (#349) 2024-05-13 16:21:17 +02:00
945285175a Set version 3.1.0 2024-02-21 15:19:24 +01:00
cfb29485b0 Use package:http (#334) 2024-02-21 15:11:36 +01:00
31ab666099 Add codecov (#333) 2024-02-21 10:03:45 +01:00
1c665c7756 Small fixes (#331) 2024-01-11 13:41:39 +01:00
cad1806f2e Allow easing to go negative for bounce in/out (#330)
Don't clamp interpolated distance along path to 'progress' value between
0 and 1.

Bounce in / Bounce out easings can transform the `progress` to negative
values or values higher than 1. `getTangentForOffset` unfortunately
clamps the input to be between 0 and 1, so we need to handle the `t < 0`
and `t > 1` cases separately.
2024-01-11 12:14:40 +01:00
08e9678dc3 Background loading & RenderCache.drawingCommands (#326) 2023-12-22 18:21:28 +01:00
9f4a8d74d5 Fix wrong order of lerp when parsing of color stops (#324)
The `_getColorInBetweenColorStops` interpolated between color stops with
the order of stops inverted between the two it should interpolate with
(comparing with `_getColorInBetweenOpacityStops` confirms this as well).
This means that if there is more than two stops in the gradient, the
second color in the gradient never appears and the third one takes its
place, and the colors are on the wrong stop after that.
2023-12-18 14:40:24 +01:00
c7066ca444 Reduce memory allocated for the renderCache (#320) 2023-11-25 15:25:49 +01:00
faf7d74029 Add support for layer blend mode (#319)
- Implement auto-orient
- Add support for layer blend mode
2023-11-22 09:43:17 +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
16874cb6fc Fix bugs on building ios example (#311)
1. `Podfile` is too old
2. build name and build number aren't specified
2023-11-02 16:24:38 +01:00
9e9de6d5b6 Bring some latest fixes (#307)
- Fix gradient interpolation for opacity stops beyond the last color
stop
- Add color value callback to solid layer
2023-10-20 15:50:31 +02:00
ab9b5833c3 Support loading fonts from zip (#300)
Fixes #299
2023-09-12 10:12:50 +02:00
0600c44384 Accept List<int> in LottieComposition.fromBytes (#292) 2023-08-08 11:17:12 +02:00
8a9ef53c63 v2.5 2023-07-17 22:08:46 +02:00
6ffeaa603f Allow shape to be null (#291) 2023-07-17 22:06:30 +02:00
08e629adaa Fix TextLayer opacity calculation (#285) 2023-07-17 20:17:35 +02:00
bf3118b4cf Add layer-level opacity option to LottieOptions (#286) 2023-06-16 15:17:07 +02:00
124ba6997b Allow RoundedCorners name to be null (#283)
Fixes
https://github.com/xvrh/lottie-flutter/issues/270#issuecomment-1573958860
2023-06-02 21:28:52 +02:00
fdc4018f57 Add an example on how to cache animation as List<Image> (#282) 2023-06-02 13:45:22 +02:00
b61ea14116 Upgrade to Flutter 3.10 & update lints (#280) 2023-05-10 23:09:40 +02:00
9c266bb98b Fix bitwise comparaison on web (#274)
Fixes #273
2023-04-06 16:07:37 +02:00
cd4cc910c4 Use a default value for ShapeTrimPathType (#272) 2023-03-28 10:50:38 +02:00
92502f1358 Fix an assertion for null ShapeTrimPathType.type (#271)
Fixes #270
2023-03-27 22:44:26 +02:00
4520221a28 Update changelog 2023-03-14 15:20:09 +01:00
3f5422d44b Update point text y offset (#268) 2023-03-14 15:07:42 +01:00
1e9861e43f Pub upgrade 2023-02-28 13:52:27 +01: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
9d4e66ea6b Run pub upgrade (#262) 2023-01-27 22:27:34 +01:00
1b752bf341 Apply latest fixes from Lottie-Android (#256)
- Overhaul text layout
- Fix rounded corners modifying already rounded corners
- Support box position in Document Data
- Allow interpolating between gradients with different opacity stops
- De-dupe gradient stops
- Add support for gradient opacity stops
2023-01-10 10:07:07 +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
8ce429cdf4 Breaking change: Remove window.devicePixelRatio from the parser (#240) 2022-11-09 14:38:50 +01:00
fc450a88f4 Fix some warnings with Flutter 3.3 (#235) 2022-09-14 13:21:29 +02:00
c0bc257f4f use FilterQuality.low to default when draw image layer to fix some image render sawtooth (#230) 2022-08-25 11:55:26 +02: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
a52977f2b3 Fix onWarning callback (#156) 2021-07-08 21:58: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