Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
78aeed452f |
@ -1,3 +1,6 @@
|
|||||||
|
## [0.3.2] - 2020-03-16
|
||||||
|
- Fix a bug with "repeater" content
|
||||||
|
|
||||||
## [0.3.1] - 2020-03-05
|
## [0.3.1] - 2020-03-05
|
||||||
- Support dashed path
|
- Support dashed path
|
||||||
|
|
||||||
|
1458
example/assets/17297-fireworks.json
Normal file
@ -108,7 +108,7 @@ packages:
|
|||||||
path: ".."
|
path: ".."
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "0.3.1"
|
version: "0.3.2"
|
||||||
matcher:
|
matcher:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
23
example/test/fireworks_test.dart
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
import 'dart:ui';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
import 'package:lottie/lottie.dart';
|
||||||
|
import 'package:path/path.dart' as p;
|
||||||
|
import 'utils.dart';
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
testWidgets('Animations with stroke', (tester) async {
|
||||||
|
var size = Size(500, 400);
|
||||||
|
tester.binding.window.physicalSizeTestValue = size;
|
||||||
|
tester.binding.window.devicePixelRatioTestValue = 1.0;
|
||||||
|
|
||||||
|
var composition = await LottieComposition.fromBytes(
|
||||||
|
File('assets/17297-fireworks.json').readAsBytesSync());
|
||||||
|
|
||||||
|
await tester.pumpWidget(FilmStrip(composition, size: size));
|
||||||
|
|
||||||
|
await expectLater(find.byType(FilmStrip),
|
||||||
|
matchesGoldenFile(p.join('goldens/fireworks.png')));
|
||||||
|
});
|
||||||
|
}
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
BIN
example/test/goldens/fireworks.png
Normal file
After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 21 KiB |
@ -71,10 +71,8 @@ class RepeaterContent
|
|||||||
var newContents = <Content>[];
|
var newContents = <Content>[];
|
||||||
while (index >= 0) {
|
while (index >= 0) {
|
||||||
var content = contents[index];
|
var content = contents[index];
|
||||||
if (content is PathContent) {
|
newContents.add(content);
|
||||||
newContents.add(content);
|
contents.removeAt(index);
|
||||||
contents.removeAt(index);
|
|
||||||
}
|
|
||||||
--index;
|
--index;
|
||||||
}
|
}
|
||||||
newContents = newContents.reversed.toList();
|
newContents = newContents.reversed.toList();
|
||||||
|
@ -158,23 +158,25 @@ class TransformKeyframeAnimation {
|
|||||||
Matrix4 getMatrixForRepeater(double amount) {
|
Matrix4 getMatrixForRepeater(double amount) {
|
||||||
final position = _position?.value;
|
final position = _position?.value;
|
||||||
final scale = _scale?.value;
|
final scale = _scale?.value;
|
||||||
final rotation = _rotation?.value;
|
|
||||||
|
|
||||||
_matrix.setIdentity();
|
_matrix.setIdentity();
|
||||||
|
|
||||||
if (position != null) {
|
if (position != null) {
|
||||||
_matrix.translate(position.dx, position.dy);
|
_matrix.translate(position.dx * amount, position.dy * amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scale != null) {
|
if (scale != null) {
|
||||||
_matrix.scale(scale.dx, scale.dy);
|
_matrix.scale(
|
||||||
|
pow(scale.dx, amount).toDouble(), pow(scale.dy, amount).toDouble());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rotation != null) {
|
if (_rotation != null) {
|
||||||
final anchorPoint = _anchorPoint?.value ?? Offset.zero;
|
var rotation = _rotation.value;
|
||||||
_matrix.translate(anchorPoint.dx, anchorPoint.dy);
|
var anchorPoint = _anchorPoint?.value;
|
||||||
_matrix.rotateZ(rotation * pi / 180.0);
|
_matrix.rotate(
|
||||||
_matrix.translate(-anchorPoint.dx, -anchorPoint.dy);
|
Vector3(anchorPoint == null ? 0.0 : anchorPoint.dx,
|
||||||
|
anchorPoint == null ? 0.0 : anchorPoint.dy, 1.0),
|
||||||
|
radians(rotation * amount));
|
||||||
}
|
}
|
||||||
|
|
||||||
return _matrix;
|
return _matrix;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name: lottie
|
name: lottie
|
||||||
description: Render After Effects animations natively on Flutter. This package is a pure Dart implementation of a Lottie player.
|
description: Render After Effects animations natively on Flutter. This package is a pure Dart implementation of a Lottie player.
|
||||||
version: 0.3.1
|
version: 0.3.2
|
||||||
homepage: https://github.com/xvrh/lottie-flutter
|
homepage: https://github.com/xvrh/lottie-flutter
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
|