Releases: xvrh/lottie-flutter
Releases · xvrh/lottie-flutter
v2.1.0
- Improve the cache to ensure that the animation is available on the first frame.
The methodAssetLottie('anim.json').load()
returns aSynchronousFuture
if it has been loaded previously. - Expose the
LottieCache
singleton.
It allows to change the cache behaviour and clear the entries.
void main() {
Lottie.cache.maximumSize = 10;
Lottie.cache.clear();
Lottie.cache.evict(NetworkLottie('https://lottie.com/anim.json'));
}
v2.0.0
Breaking change: the lottie widget will be smaller if it relies on the intrinsic size of the composition.
Previously the lottie parser was automatically multiplying the size of the composition by window.devicePixelRatio. This was incorrect as it results in a widget of a different size depending on the pixel ratio of the monitor. Furthermore, it created some bugs when the property window.devicePixelRatio was not available immediately at the start of the app (on Android release builds).
The code can be adapted to specify explicitly the size of the animation with width, height and fit properties.
Scaffold(
body: Center(
child: Lottie.asset(
'assets/LottieLogo1.json',
height: 800,
fit: BoxFit.contain,
),
),
);
v1.4.3
v1.4.2
v1.4.1
v1.4.0
v1.3.0
- Added support for rounded corners on shapes and rects
- Add support for text in dynamic properties (
ValueDelegate
)
Example:
Lottie.asset(
'assets/DynamicText.json',
delegates: LottieDelegates(values: [
ValueDelegate.text(
['Text layer'], // The path to the text element to change
value: 'The new text',
),
]),
)
- Improve stroke with offset
- Add support for reversed polystar paths
- Enforce order of operations to avoid rounding errors
v1.2.2
v1.2.1
v1.2.0
- Add support for gaussian blurs.
Example to blur some elements dynamically:
Lottie.asset(
'assets/AndroidWave.json',
delegates: LottieDelegates(values: [
ValueDelegate.blurRadius(
['**'], // The path to the element to blur
value: 20,
),
]),
)
- Add support for drop shadows.
Example to add a shadow dynamically:
Lottie.asset(
'assets/animation.json',
delegates: LottieDelegates(values: [
ValueDelegate.dropShadow(
['**'], // The path to the elements with shadow
value: const DropShadow(
color: Colors.blue,
direction: 140,
distance: 60,
radius: 10,
),
),
]),
)