diff --git a/.github/workflows/analyze-and-test.yaml b/.github/workflows/analyze-and-test.yaml index 02d919e..17dc182 100644 --- a/.github/workflows/analyze-and-test.yaml +++ b/.github/workflows/analyze-and-test.yaml @@ -8,15 +8,12 @@ on: jobs: analyze_and_test: name: Flutter analyze - strategy: - matrix: - flutter: ['stable'] runs-on: macos-13 steps: - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 with: - channel: ${{ matrix.flutter }} + channel: 'stable' - run: flutter doctor - run: flutter --version - run: flutter pub get diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml new file mode 100644 index 0000000..8685ae1 --- /dev/null +++ b/.github/workflows/coverage.yaml @@ -0,0 +1,22 @@ +name: Coverage +on: + pull_request: + push: + branches: + - master + +jobs: + coverage: + name: Coverage + runs-on: macos-13 + steps: + - uses: actions/checkout@v4 + - uses: subosito/flutter-action@v2 + with: + channel: 'stable' + - run: flutter test --coverage + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/analysis_options.yaml b/analysis_options.yaml index 94627ef..1e0001a 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -18,7 +18,6 @@ linter: avoid_js_rounded_ints: true avoid_positional_boolean_parameters: true avoid_redundant_argument_values: true - avoid_returning_null_for_future: true avoid_setters_without_getters: true avoid_type_to_string: true avoid_unused_constructor_parameters: true diff --git a/example/pubspec.lock b/example/pubspec.lock index 14de9f3..318fde1 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -139,6 +139,30 @@ packages: url: "https://pub.dev" source: hosted version: "0.6.7" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" + url: "https://pub.dev" + source: hosted + version: "10.0.0" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 + url: "https://pub.dev" + source: hosted + version: "2.0.1" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 + url: "https://pub.dev" + source: hosted + version: "2.0.1" lints: dependency: transitive description: @@ -166,34 +190,34 @@ packages: dependency: transitive description: name: matcher - sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.16" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.8.0" meta: dependency: transitive description: name: meta - sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" path: dependency: "direct main" description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.8.3" + version: "1.9.0" path_provider: dependency: "direct main" description: @@ -335,6 +359,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 + url: "https://pub.dev" + source: hosted + version: "13.0.0" web: dependency: transitive description: diff --git a/lib/src/lottie_property.dart b/lib/src/lottie_property.dart index 8bea78e..cd27df1 100644 --- a/lib/src/lottie_property.dart +++ b/lib/src/lottie_property.dart @@ -2,54 +2,54 @@ import 'dart:ui'; import 'value/drop_shadow.dart'; /// Property values are the same type as the generic type of their corresponding -/// {@link LottieValueCallback}. With this, we can use generics to maintain type safety +/// [LottieValueCallback]. With this, we can use generics to maintain type safety /// of the callbacks. /// /// Supported properties: /// Transform: -/// {@link #TRANSFORM_ANCHOR_POINT} -/// {@link #TRANSFORM_POSITION} -/// {@link #TRANSFORM_OPACITY} -/// {@link #TRANSFORM_SCALE} -/// {@link #TRANSFORM_ROTATION} -/// {@link #TRANSFORM_SKEW} -/// {@link #TRANSFORM_SKEW_ANGLE} +/// {TRANSFORM_ANCHOR_POINT} +/// {TRANSFORM_POSITION} +/// {TRANSFORM_OPACITY} +/// {TRANSFORM_SCALE} +/// {TRANSFORM_ROTATION} +/// {TRANSFORM_SKEW} +/// {TRANSFORM_SKEW_ANGLE} /// /// Fill: -/// {@link #COLOR} (non-gradient) -/// {@link #OPACITY} -/// {@link #COLOR_FILTER} +/// {#COLOR} (non-gradient) +/// {#OPACITY} +/// {#COLOR_FILTER} /// /// Stroke: -/// {@link #COLOR} (non-gradient) -/// {@link #STROKE_WIDTH} -/// {@link #OPACITY} -/// {@link #COLOR_FILTER} +/// {#COLOR} (non-gradient) +/// {#STROKE_WIDTH} +/// {#OPACITY} +/// {#COLOR_FILTER} /// /// Ellipse: -/// {@link #POSITION} -/// {@link #ELLIPSE_SIZE} +/// {#POSITION} +/// {#ELLIPSE_SIZE} /// /// Polystar: -/// {@link #POLYSTAR_POINTS} -/// {@link #POLYSTAR_ROTATION} -/// {@link #POSITION} -/// {@link #POLYSTAR_INNER_RADIUS} (star) -/// {@link #POLYSTAR_OUTER_RADIUS} -/// {@link #POLYSTAR_INNER_ROUNDEDNESS} (star) -/// {@link #POLYSTAR_OUTER_ROUNDEDNESS} +/// {#POLYSTAR_POINTS} +/// {#POLYSTAR_ROTATION} +/// {#POSITION} +/// {#POLYSTAR_INNER_RADIUS} (star) +/// {#POLYSTAR_OUTER_RADIUS} +/// {#POLYSTAR_INNER_ROUNDEDNESS} (star) +/// {#POLYSTAR_OUTER_ROUNDEDNESS} /// /// Repeater: /// All transform properties -/// {@link #REPEATER_COPIES} -/// {@link #REPEATER_OFFSET} -/// {@link #TRANSFORM_ROTATION} -/// {@link #TRANSFORM_START_OPACITY} -/// {@link #TRANSFORM_END_OPACITY} +/// {#REPEATER_COPIES} +/// {#REPEATER_OFFSET} +/// {#TRANSFORM_ROTATION} +/// {#TRANSFORM_START_OPACITY} +/// {#TRANSFORM_END_OPACITY} /// /// Layers: /// All transform properties -/// {@link #TIME_REMAP} (composition layers only) +/// {#TIME_REMAP} (composition layers only) abstract class LottieProperty { /// ColorInt **/ static const Color color = Color(0x00000001); diff --git a/lib/src/parser/moshi/buffer.dart b/lib/src/parser/moshi/buffer.dart index 01aa24d..55e5c81 100644 --- a/lib/src/parser/moshi/buffer.dart +++ b/lib/src/parser/moshi/buffer.dart @@ -66,7 +66,7 @@ class Buffer { } /// Reads and discards {@code byteCount} bytes from this source. Throws an - /// {@link java.io.EOFException} if the source is exhausted before the + /// [Exception] if the source is exhausted before the /// requested bytes can be skipped. void skip(int byteCount) { _start += byteCount; diff --git a/lib/src/parser/moshi/json_utf8_reader.dart b/lib/src/parser/moshi/json_utf8_reader.dart index 05ee2c1..a8d4ee5 100644 --- a/lib/src/parser/moshi/json_utf8_reader.dart +++ b/lib/src/parser/moshi/json_utf8_reader.dart @@ -857,7 +857,7 @@ class JsonUtf8Reader extends JsonReader { /// Returns the next character in the stream that is neither whitespace nor a /// part of a comment. When this returns, the returned character is always at - /// {@code buffer.getByte(0)}. + /// {buffer.getByte(0)}. int _nextNonWhitespace(bool throwOnEof) { // This code uses ugly local variables 'p' and 'l' representing the 'pos' // and 'limit' fields respectively. Using locals rather than fields saves diff --git a/lib/src/providers/asset_provider.dart b/lib/src/providers/asset_provider.dart index 81c719b..c4dbf27 100644 --- a/lib/src/providers/asset_provider.dart +++ b/lib/src/providers/asset_provider.dart @@ -74,7 +74,7 @@ class AssetLottie extends LottieProvider { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) return false; return other is AssetLottie && other.keyName == keyName && diff --git a/lib/src/providers/file_provider.dart b/lib/src/providers/file_provider.dart index a68a1e4..68aebea 100644 --- a/lib/src/providers/file_provider.dart +++ b/lib/src/providers/file_provider.dart @@ -50,7 +50,7 @@ class FileLottie extends LottieProvider { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) return false; return other is FileLottie && io.areFilesEqual(file, other.file); } diff --git a/lib/src/providers/memory_provider.dart b/lib/src/providers/memory_provider.dart index f5ac91d..2e1b238 100644 --- a/lib/src/providers/memory_provider.dart +++ b/lib/src/providers/memory_provider.dart @@ -50,7 +50,7 @@ class MemoryLottie extends LottieProvider { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) return false; //TODO(xha): compare bytes content diff --git a/lib/src/providers/network_provider.dart b/lib/src/providers/network_provider.dart index 23ec53a..5652771 100644 --- a/lib/src/providers/network_provider.dart +++ b/lib/src/providers/network_provider.dart @@ -60,7 +60,7 @@ class NetworkLottie extends LottieProvider { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other.runtimeType != runtimeType) return false; return other is NetworkLottie && other.url == url && diff --git a/lib/src/utils/misc.dart b/lib/src/utils/misc.dart index 7146297..659a0c4 100644 --- a/lib/src/utils/misc.dart +++ b/lib/src/utils/misc.dart @@ -96,7 +96,7 @@ class MiscUtils { /// it to the accumulator list. /// /// Any {@link KeyPathElementContent} should call through to this as its implementation of - /// {@link KeyPathElementContent#resolveKeyPath(KeyPath, int, List, KeyPath)}. + /// {KeyPathElementContent#resolveKeyPath(KeyPath, int, List, KeyPath)}. static void resolveKeyPath( KeyPath keyPath, int depth, diff --git a/lib/src/value_delegate.dart b/lib/src/value_delegate.dart index cb0517f..153dbca 100644 --- a/lib/src/value_delegate.dart +++ b/lib/src/value_delegate.dart @@ -331,7 +331,7 @@ class ResolvedValueDelegate { /// to multiple contents. In that case, the callbacks's value will apply to all of them. ///

/// Internally, this will check if the {@link KeyPath} has already been resolved with - /// {@link #resolveKeyPath(KeyPath)} and will resolve it if it hasn't. + /// {#resolveKeyPath(KeyPath)} and will resolve it if it hasn't. void addValueCallback(LottieDrawable drawable) { var invalidate = false; if (valueDelegate.keyPath.isEmpty) { diff --git a/pubspec.lock b/pubspec.lock index d6aa2dd..b756cc3 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -147,6 +147,30 @@ packages: url: "https://pub.dev" source: hosted version: "0.6.7" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" + url: "https://pub.dev" + source: hosted + version: "10.0.0" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 + url: "https://pub.dev" + source: hosted + version: "2.0.1" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 + url: "https://pub.dev" + source: hosted + version: "2.0.1" lints: dependency: transitive description: @@ -159,26 +183,26 @@ packages: dependency: transitive description: name: matcher - sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.16" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.8.0" meta: dependency: transitive description: name: meta - sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" package_config: dependency: transitive description: @@ -191,10 +215,10 @@ packages: dependency: "direct main" description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.8.3" + version: "1.9.0" pointycastle: dependency: transitive description: @@ -280,6 +304,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 + url: "https://pub.dev" + source: hosted + version: "13.0.0" watcher: dependency: transitive description: @@ -288,14 +320,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.0" - web: - dependency: transitive - description: - name: web - sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 - url: "https://pub.dev" - source: hosted - version: "0.3.0" yaml: dependency: "direct dev" description: diff --git a/test/goldens/all/Tests/interpolatebetweenopacitystops.png b/test/goldens/all/Tests/interpolatebetweenopacitystops.png index 58057dd..77e9e70 100644 Binary files a/test/goldens/all/Tests/interpolatebetweenopacitystops.png and b/test/goldens/all/Tests/interpolatebetweenopacitystops.png differ diff --git a/test/goldens/all/Tests/map.png b/test/goldens/all/Tests/map.png index cb2d253..83f4dcc 100644 Binary files a/test/goldens/all/Tests/map.png and b/test/goldens/all/Tests/map.png differ diff --git a/test/goldens/all/lottiefiles/ball_&_map.png b/test/goldens/all/lottiefiles/ball_&_map.png index 5a0f06c..6d5e48c 100644 Binary files a/test/goldens/all/lottiefiles/ball_&_map.png and b/test/goldens/all/lottiefiles/ball_&_map.png differ diff --git a/test/goldens/all/lottiefiles/download copy.png b/test/goldens/all/lottiefiles/download copy.png index c079676..fedde7c 100644 Binary files a/test/goldens/all/lottiefiles/download copy.png and b/test/goldens/all/lottiefiles/download copy.png differ