Compare commits
2 Commits
v3.0.0-alp
...
update-gol
Author | SHA1 | Date | |
---|---|---|---|
e303633132 | |||
7fe343d819 |
@ -11,7 +11,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
flutter: ['stable']
|
||||
runs-on: macos-latest
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: subosito/flutter-action@v1
|
||||
@ -22,9 +22,6 @@ jobs:
|
||||
- run: flutter pub get
|
||||
working-directory: example
|
||||
- run: flutter analyze
|
||||
- run: flutter test test # https://github.com/flutter/flutter/issues/20907
|
||||
- run: flutter test test
|
||||
working-directory: example
|
||||
- run: flutter pub run tool/prepare_submit.dart
|
||||
- name: "check for uncommitted changes"
|
||||
run: |
|
17
.github/workflows/test.yaml
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
name: Lottie Flutter
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Run all tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run tests
|
||||
uses: docker://cirrusci/flutter:1.22.1
|
||||
with:
|
||||
args: sh run_tests.sh
|
7
CONTRIBUTING.md
Normal file
@ -0,0 +1,7 @@
|
||||
|
||||
## Run the Golden tests
|
||||
Run and update the golden tests requires Docker installed.
|
||||
|
||||
```shell script
|
||||
sh update_goldens.sh
|
||||
```
|
@ -7,14 +7,14 @@ packages:
|
||||
name: archive
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.13"
|
||||
version: "2.0.11"
|
||||
args:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: args
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.6.0"
|
||||
version: "1.5.2"
|
||||
async:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -70,7 +70,7 @@ packages:
|
||||
name: crypto
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.5"
|
||||
version: "2.1.3"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -213,7 +213,7 @@ packages:
|
||||
name: pedantic
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.9.2"
|
||||
version: "1.8.0+1"
|
||||
platform:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -309,7 +309,7 @@ packages:
|
||||
name: xdg_directories
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.1.2"
|
||||
version: "0.1.0"
|
||||
sdks:
|
||||
dart: ">=2.10.0-110 <2.11.0"
|
||||
flutter: ">=1.12.13+hotfix.5 <2.0.0"
|
||||
|
@ -22,6 +22,9 @@ void main() {
|
||||
.replaceAll(' ', '_');
|
||||
|
||||
testWidgets(description, (tester) async {
|
||||
tester.binding.window.physicalSizeTestValue = Size(500, 400);
|
||||
tester.binding.window.devicePixelRatioTestValue = 1.0;
|
||||
|
||||
var animation =
|
||||
AnimationController(vsync: tester, duration: composition.duration);
|
||||
if (progress != null) {
|
||||
|
@ -6,6 +6,9 @@ import 'package:lottie/lottie.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('Dynamic test', (tester) async {
|
||||
tester.binding.window.physicalSizeTestValue = Size(500, 400);
|
||||
tester.binding.window.devicePixelRatioTestValue = 1.0;
|
||||
|
||||
var composition = await LottieComposition.fromBytes(
|
||||
File('assets/Tests/DynamicText.json').readAsBytesSync());
|
||||
|
||||
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 9.5 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 6.0 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 9.9 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 9.9 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 9.9 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 9.7 KiB |
@ -7,6 +7,9 @@ import 'package:lottie/lottie.dart';
|
||||
void main() {
|
||||
void testGradient(String name, ValueDelegate valueDelegate) {
|
||||
testWidgets(name, (tester) async {
|
||||
tester.binding.window.physicalSizeTestValue = Size(500, 400);
|
||||
tester.binding.window.devicePixelRatioTestValue = 1.0;
|
||||
|
||||
var composition = await LottieComposition.fromBytes(
|
||||
File('assets/Tests/DynamicGradient.json').readAsBytesSync());
|
||||
|
||||
|
79
pubspec.lock
@ -7,28 +7,28 @@ packages:
|
||||
name: _fe_analyzer_shared
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "11.0.0"
|
||||
version: "7.0.0"
|
||||
analyzer:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: analyzer
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.40.4"
|
||||
version: "0.39.17"
|
||||
archive:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: archive
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.13"
|
||||
version: "2.0.11"
|
||||
args:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: args
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.6.0"
|
||||
version: "1.5.2"
|
||||
async:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -43,27 +43,6 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0-nullsafety.1"
|
||||
build:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.5.0"
|
||||
built_collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: built_collection
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.3.2"
|
||||
built_value:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: built_value
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "7.1.0"
|
||||
characters:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -92,13 +71,6 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety.1"
|
||||
code_builder:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: code_builder
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.5.0"
|
||||
collection:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -119,14 +91,21 @@ packages:
|
||||
name: crypto
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.5"
|
||||
version: "2.1.3"
|
||||
csslib:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: csslib
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.16.2"
|
||||
dart_style:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: dart_style
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.8"
|
||||
version: "1.3.6"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -134,13 +113,6 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0-nullsafety.1"
|
||||
fixnum:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fixnum
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.10.11"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
@ -158,6 +130,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
html:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: html
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.14.0+4"
|
||||
js:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -192,7 +171,7 @@ packages:
|
||||
name: mockito
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.1.3"
|
||||
version: "4.1.1"
|
||||
node_interop:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -227,7 +206,7 @@ packages:
|
||||
name: pedantic
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.9.2"
|
||||
version: "1.8.0+1"
|
||||
pub_semver:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -235,25 +214,11 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.4.4"
|
||||
quiver:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: quiver
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.3"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.99"
|
||||
source_gen:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_gen
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.9.7+1"
|
||||
source_span:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
2
run_tests.sh
Normal file
@ -0,0 +1,2 @@
|
||||
flutter test test
|
||||
(cd example && flutter test test)
|
1
update_goldens.sh
Normal file
@ -0,0 +1 @@
|
||||
docker run --rm -it -v "${PWD}":/build --workdir /build cirrusci/flutter:1.22.1 sh update_goldens_inside_docker.sh
|
12
update_goldens_inside_docker.sh
Normal file
@ -0,0 +1,12 @@
|
||||
PUB_CACHE="$(mktemp -d)"
|
||||
export PUB_CACHE
|
||||
COPY_DIR="$(mktemp -d)"
|
||||
|
||||
(cd /build && git ls-files | xargs -I '{}' cp -pR --parents '{}' "$COPY_DIR")
|
||||
cd "$COPY_DIR" || exit
|
||||
flutter test --update-goldens test
|
||||
cp -pR test/* /build/test
|
||||
|
||||
cd example || exit
|
||||
flutter test --update-goldens test
|
||||
cp -pR test/* /build/example/test
|