mirror of
https://github.com/xvrh/lottie-flutter.git
synced 2025-08-06 16:39:36 +08:00
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
a0b9572315 |
16
.github/workflows/analyze-and-test.yaml
vendored
16
.github/workflows/analyze-and-test.yaml
vendored
@ -6,11 +6,11 @@ on:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
analyze_and_test:
|
||||
analyze:
|
||||
name: Flutter analyze
|
||||
strategy:
|
||||
matrix:
|
||||
flutter: ['beta']
|
||||
flutter: ['stable', 'beta']
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
@ -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: |
|
||||
@ -33,6 +30,15 @@ jobs:
|
||||
"and check in all changes" \
|
||||
&& exit 1)
|
||||
shell: bash
|
||||
test:
|
||||
name: Run all tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run tests
|
||||
uses: docker://cirrusci/flutter:2.0.6
|
||||
with:
|
||||
args: sh run_tests.sh
|
||||
build_web_version:
|
||||
name: Check that the web version compile
|
||||
runs-on: ubuntu-latest
|
||||
|
7
CONTRIBUTING.md
Normal file
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
|
||||
```
|
@ -5,11 +5,13 @@ analyzer:
|
||||
implicit-dynamic: false
|
||||
linter:
|
||||
rules:
|
||||
avoid_dynamic_calls: true
|
||||
avoid_renaming_method_parameters: true
|
||||
avoid_returning_null_for_future: true
|
||||
avoid_returning_null_for_void: true
|
||||
avoid_returning_this: true
|
||||
avoid_setters_without_getters: true
|
||||
avoid_web_libraries_in_flutter: true
|
||||
await_only_futures: true
|
||||
camel_case_types: true
|
||||
cancel_subscriptions: true
|
||||
@ -25,6 +27,7 @@ linter:
|
||||
overridden_fields: true
|
||||
prefer_inlined_adds: true
|
||||
prefer_interpolation_to_compose_strings: true
|
||||
prefer_null_aware_method_calls: true
|
||||
prefer_null_aware_operators: true
|
||||
prefer_relative_imports: true
|
||||
prefer_typing_uninitialized_variables: true
|
||||
@ -32,7 +35,9 @@ linter:
|
||||
test_types_in_equals: true
|
||||
unnecessary_brace_in_string_interps: true
|
||||
unnecessary_getters_setters: true
|
||||
unnecessary_null_checks: true
|
||||
unnecessary_parenthesis: true
|
||||
unnecessary_statements: true
|
||||
use_function_type_syntax_for_parameters: true
|
||||
use_if_null_to_convert_nulls_to_bools: true
|
||||
void_checks: true
|
||||
|
@ -95,13 +95,6 @@ packages:
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
golden_toolkit:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: golden_toolkit
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.9.0"
|
||||
http:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -225,7 +218,7 @@ packages:
|
||||
name: source_span
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0"
|
||||
version: "1.8.1"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -260,7 +253,7 @@ packages:
|
||||
name: test_api
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.19"
|
||||
version: "0.3.0"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -17,7 +17,6 @@ dependencies:
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
golden_toolkit:
|
||||
|
||||
# For information on the generic Dart part of this file, see the
|
||||
# following page: https://dart.dev/tools/pub/pubspec
|
||||
|
@ -1,3 +1,5 @@
|
||||
// This file is using conditional import so it is safe to import dart:html
|
||||
// ignore: avoid_web_libraries_in_flutter
|
||||
import 'dart:html';
|
||||
import 'dart:typed_data';
|
||||
import 'package:flutter/rendering.dart';
|
||||
|
@ -1,6 +1,6 @@
|
||||
name: lottie
|
||||
description: Render After Effects animations natively on Flutter. This package is a pure Dart implementation of a Lottie player.
|
||||
version: 1.0.1
|
||||
version: 1.0.2
|
||||
homepage: https://github.com/xvrh/lottie-flutter
|
||||
|
||||
environment:
|
||||
|
2
run_tests.sh
Normal file
2
run_tests.sh
Normal file
@ -0,0 +1,2 @@
|
||||
flutter test test
|
||||
(cd example && flutter test test)
|
@ -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) {
|
||||
|
@ -5,6 +5,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('example/assets/Tests/DynamicText.json').readAsBytesSync());
|
||||
|
||||
|
@ -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('example/assets/Tests/DynamicGradient.json').readAsBytesSync());
|
||||
|
||||
|
1
update_goldens.sh
Normal file
1
update_goldens.sh
Normal file
@ -0,0 +1 @@
|
||||
docker run --rm -it -v "${PWD}":/build --workdir /build cirrusci/flutter:2.0.6 sh update_goldens_inside_docker.sh
|
12
update_goldens_inside_docker.sh
Normal file
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
|
Reference in New Issue
Block a user