Compare commits

...

9 Commits

Author SHA1 Message Date
ba039e9423 Allow missing end values for integer animations (#349) 2024-05-13 16:21:17 +02:00
3c58936d36 Fix rounding-off error on progress calculation (#346)
I fix a blinking issue when change lottie progress. The duration of
compositon has offset in LottieCompositionParser (parameters.endFrame =
reader.nextDouble() - 0.01), but progress calculate is based on the
original value(no-offset), the function roundProgress() will caculate a
error progress.

The issue is same as: airbnb/lottie-android#1372.

---------

Co-authored-by: Xavier Hainaux <xavier.hainaux@gmail.com>
2024-05-12 20:16:11 +02:00
d0fed17a70 Bump codecov/codecov-action from 4.3.0 to 4.3.1 (#347) 2024-05-06 07:23:21 +02:00
1c113d961a Bump codecov/codecov-action from 4.2.0 to 4.3.0 (#343) 2024-04-15 10:15:38 +02:00
17449658bb Bump codecov/codecov-action from 4.1.0 to 4.2.0 (#341) 2024-04-08 08:47:39 +02:00
e258c610f5 Bump codecov/codecov-action from 4.0.1 to 4.1.0 (#336)
Bumps
[codecov/codecov-action](https://github.com/codecov/codecov-action) from
4.0.1 to 4.1.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/codecov/codecov-action/releases">codecov/codecov-action's
releases</a>.</em></p>
<blockquote>
<h2>v4.1.0</h2>
<h2>What's Changed</h2>
<ul>
<li>fix: set safe directory by <a
href="https://github.com/thomasrockhu-codecov"><code>@​thomasrockhu-codecov</code></a>
in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1304">codecov/codecov-action#1304</a></li>
<li>build(deps): bump github/codeql-action from 3.24.3 to 3.24.5 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1306">codecov/codecov-action#1306</a></li>
<li>build(deps-dev): bump eslint from 8.56.0 to 8.57.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1305">codecov/codecov-action#1305</a></li>
<li>chore(release): v4.1.0 by <a
href="https://github.com/thomasrockhu-codecov"><code>@​thomasrockhu-codecov</code></a>
in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1307">codecov/codecov-action#1307</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/codecov/codecov-action/compare/v4.0.2...v4.1.0">https://github.com/codecov/codecov-action/compare/v4.0.2...v4.1.0</a></p>
<h2>v4.0.2</h2>
<h2>What's Changed</h2>
<ul>
<li>Update README.md by <a
href="https://github.com/thomasrockhu-codecov"><code>@​thomasrockhu-codecov</code></a>
in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1251">codecov/codecov-action#1251</a></li>
<li>build(deps-dev): bump <code>@​types/jest</code> from 29.5.11 to
29.5.12 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1257">codecov/codecov-action#1257</a></li>
<li>build(deps): bump github/codeql-action from 3.23.2 to 3.24.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1266">codecov/codecov-action#1266</a></li>
<li>Escape pipes in table of arguments by <a
href="https://github.com/jwodder"><code>@​jwodder</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1265">codecov/codecov-action#1265</a></li>
<li>Add link to docs on Dependabot secrets by <a
href="https://github.com/ianlewis"><code>@​ianlewis</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1260">codecov/codecov-action#1260</a></li>
<li>fix: working-directory input for all stages by <a
href="https://github.com/Bo98"><code>@​Bo98</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1272">codecov/codecov-action#1272</a></li>
<li>build(deps-dev): bump <code>@​typescript-eslint/parser</code> from
6.20.0 to 6.21.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1271">codecov/codecov-action#1271</a></li>
<li>build(deps-dev): bump <code>@​typescript-eslint/eslint-plugin</code>
from 6.20.0 to 6.21.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1269">codecov/codecov-action#1269</a></li>
<li>build(deps): bump github/codeql-action from 3.24.0 to 3.24.3 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1298">codecov/codecov-action#1298</a></li>
<li>Use updated syntax for GitHub Markdown notes by <a
href="https://github.com/jamacku"><code>@​jamacku</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1300">codecov/codecov-action#1300</a></li>
<li>build(deps-dev): bump <code>@​typescript-eslint/eslint-plugin</code>
from 6.21.0 to 7.0.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1290">codecov/codecov-action#1290</a></li>
<li>build(deps): bump actions/upload-artifact from 4.3.0 to 4.3.1 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1286">codecov/codecov-action#1286</a></li>
<li>chore(release): bump to 4.0.2 by <a
href="https://github.com/thomasrockhu-codecov"><code>@​thomasrockhu-codecov</code></a>
in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1302">codecov/codecov-action#1302</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/jwodder"><code>@​jwodder</code></a> made
their first contribution in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1265">codecov/codecov-action#1265</a></li>
<li><a href="https://github.com/ianlewis"><code>@​ianlewis</code></a>
made their first contribution in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1260">codecov/codecov-action#1260</a></li>
<li><a href="https://github.com/Bo98"><code>@​Bo98</code></a> made their
first contribution in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1272">codecov/codecov-action#1272</a></li>
<li><a href="https://github.com/jamacku"><code>@​jamacku</code></a> made
their first contribution in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1300">codecov/codecov-action#1300</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/codecov/codecov-action/compare/v4.0.1...v4.0.2">https://github.com/codecov/codecov-action/compare/v4.0.1...v4.0.2</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="54bcd8715e"><code>54bcd87</code></a>
chore(release): v4.1.0 (<a
href="https://redirect.github.com/codecov/codecov-action/issues/1307">#1307</a>)</li>
<li><a
href="8ba77ef8d7"><code>8ba77ef</code></a>
build(deps-dev): bump eslint from 8.56.0 to 8.57.0 (<a
href="https://redirect.github.com/codecov/codecov-action/issues/1305">#1305</a>)</li>
<li><a
href="c60aa801e3"><code>c60aa80</code></a>
build(deps): bump github/codeql-action from 3.24.3 to 3.24.5 (<a
href="https://redirect.github.com/codecov/codecov-action/issues/1306">#1306</a>)</li>
<li><a
href="2fc4847d3f"><code>2fc4847</code></a>
fix: set safe directory (<a
href="https://redirect.github.com/codecov/codecov-action/issues/1304">#1304</a>)</li>
<li><a
href="0cfda1dd0a"><code>0cfda1d</code></a>
chore(release): bump to 4.0.2 (<a
href="https://redirect.github.com/codecov/codecov-action/issues/1302">#1302</a>)</li>
<li><a
href="7d3a55eb5e"><code>7d3a55e</code></a>
build(deps): bump actions/upload-artifact from 4.3.0 to 4.3.1 (<a
href="https://redirect.github.com/codecov/codecov-action/issues/1286">#1286</a>)</li>
<li><a
href="fe84a0b3c0"><code>fe84a0b</code></a>
build(deps-dev): bump <code>@​typescript-eslint/eslint-plugin</code>
from 6.21.0 to 7.0.0 (...</li>
<li><a
href="e12c9402c4"><code>e12c940</code></a>
Use updated syntax for GitHub Markdown notes (<a
href="https://redirect.github.com/codecov/codecov-action/issues/1300">#1300</a>)</li>
<li><a
href="ef7f8a5d3c"><code>ef7f8a5</code></a>
build(deps): bump github/codeql-action from 3.24.0 to 3.24.3 (<a
href="https://redirect.github.com/codecov/codecov-action/issues/1298">#1298</a>)</li>
<li><a
href="b8a1d6a424"><code>b8a1d6a</code></a>
build(deps-dev): bump <code>@​typescript-eslint/eslint-plugin</code>
from 6.20.0 to 6.21.0 ...</li>
<li>Additional commits viewable in <a
href="https://github.com/codecov/codecov-action/compare/v4.0.1...v4.1.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=codecov/codecov-action&package-manager=github_actions&previous-version=4.0.1&new-version=4.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-12 18:22:51 +01:00
945285175a Set version 3.1.0 2024-02-21 15:19:24 +01:00
cfb29485b0 Use package:http (#334) 2024-02-21 15:11:36 +01:00
31ab666099 Add codecov (#333) 2024-02-21 10:03:45 +01:00
47 changed files with 14396 additions and 274 deletions

View File

@ -8,15 +8,12 @@ on:
jobs: jobs:
analyze_and_test: analyze_and_test:
name: Flutter analyze name: Flutter analyze
strategy:
matrix:
flutter: ['stable']
runs-on: macos-13 runs-on: macos-13
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: subosito/flutter-action@v2 - uses: subosito/flutter-action@v2
with: with:
channel: ${{ matrix.flutter }} channel: 'stable'
- run: flutter doctor - run: flutter doctor
- run: flutter --version - run: flutter --version
- run: flutter pub get - run: flutter pub get

22
.github/workflows/coverage.yaml vendored Normal file
View File

@ -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.3.1
with:
token: ${{ secrets.CODECOV_TOKEN }}

View File

@ -1,3 +1,11 @@
## 3.1.1
- Fix rounding-off error on progress calculation
- Allow missing end values for integer animations
## 3.1.0
- Use `package:http` for `Lottie.network`. This allows to drop dependency on `dart:html` and be compatible with `wasm`.
- Fix new lints
## 3.0.0 ## 3.0.0
- Add `renderCache` parameter. - Add `renderCache` parameter.

2
FUNDING.yml Normal file
View File

@ -0,0 +1,2 @@
github: xvrh
custom: https://buymeacoffee.com/xvrh

View File

@ -18,7 +18,6 @@ linter:
avoid_js_rounded_ints: true avoid_js_rounded_ints: true
avoid_positional_boolean_parameters: true avoid_positional_boolean_parameters: true
avoid_redundant_argument_values: true avoid_redundant_argument_values: true
avoid_returning_null_for_future: true
avoid_setters_without_getters: true avoid_setters_without_getters: true
avoid_type_to_string: true avoid_type_to_string: true
avoid_unused_constructor_parameters: true avoid_unused_constructor_parameters: true

File diff suppressed because it is too large Load Diff

View File

@ -21,6 +21,6 @@
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.0</string> <string>1.0</string>
<key>MinimumOSVersion</key> <key>MinimumOSVersion</key>
<string>11.0</string> <string>12.0</string>
</dict> </dict>
</plist> </plist>

View File

@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project # Uncomment this line to define a global platform for your project
platform :ios, '11.0' platform :ios, '12.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency. # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true' ENV['COCOAPODS_DISABLE_STATS'] = 'true'

View File

@ -15,9 +15,9 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/path_provider_foundation/darwin" :path: ".symlinks/plugins/path_provider_foundation/darwin"
SPEC CHECKSUMS: SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943 path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
PODFILE CHECKSUM: 7368163408c647b7eb699d0d788ba6718e18fb8d PODFILE CHECKSUM: 4e8f8b2be68aeea4c0d5beb6ff1e79fface1d048
COCOAPODS: 1.14.2 COCOAPODS: 1.15.2

View File

@ -163,7 +163,7 @@
97C146E61CF9000F007C117D /* Project object */ = { 97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastUpgradeCheck = 1430; LastUpgradeCheck = 1510;
ORGANIZATIONNAME = ""; ORGANIZATIONNAME = "";
TargetAttributes = { TargetAttributes = {
97C146ED1CF9000F007C117D = { 97C146ED1CF9000F007C117D = {
@ -351,7 +351,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos; SUPPORTED_PLATFORMS = iphoneos;
@ -366,8 +366,10 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = TC6K7794M3; DEVELOPMENT_TEAM = PS45A9TPZ7;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
@ -382,8 +384,9 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.github.xvrh.lottie.example; PRODUCT_BUNDLE_IDENTIFIER = com.example;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";
@ -437,7 +440,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES; MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos; SDKROOT = iphoneos;
@ -486,7 +489,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos; SUPPORTED_PLATFORMS = iphoneos;
@ -502,8 +505,10 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = TC6K7794M3; DEVELOPMENT_TEAM = PS45A9TPZ7;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
@ -518,8 +523,9 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.github.xvrh.lottie.example; PRODUCT_BUNDLE_IDENTIFIER = com.example;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
@ -533,8 +539,10 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = TC6K7794M3; DEVELOPMENT_TEAM = PS45A9TPZ7;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
@ -549,8 +557,9 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.github.xvrh.lottie.example; PRODUCT_BUNDLE_IDENTIFIER = com.example;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "1430" LastUpgradeVersion = "1510"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"

View File

@ -16,8 +16,8 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943 path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7 PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7
COCOAPODS: 1.14.2 COCOAPODS: 1.15.2

View File

@ -203,7 +203,7 @@
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastSwiftUpdateCheck = 0920; LastSwiftUpdateCheck = 0920;
LastUpgradeCheck = 1430; LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "The Flutter Authors"; ORGANIZATIONNAME = "The Flutter Authors";
TargetAttributes = { TargetAttributes = {
33CC10EC2044A3C60003C045 = { 33CC10EC2044A3C60003C045 = {

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "1430" LastUpgradeVersion = "1510"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"

View File

@ -5,10 +5,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: archive name: archive
sha256: "22600aa1e926be775fa5fe7e6894e7fb3df9efda8891c73f70fb3262399a432d" sha256: ecf4273855368121b1caed0d10d4513c7241dfc813f7d3c8933b36622ae9b265
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.4.10" version: "3.5.1"
async: async:
dependency: transitive dependency: transitive
description: description:
@ -77,10 +77,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: ffi name: ffi
sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.0" version: "2.1.2"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@ -98,31 +98,23 @@ packages:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: flutter_lints name: flutter_lints
sha256: e2a421b7e59244faef694ba7b30562e489c2b489866e505074eb005cd7060db7 sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.1" version: "4.0.0"
flutter_test: flutter_test:
dependency: "direct dev" dependency: "direct dev"
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
golden_toolkit:
dependency: "direct dev"
description:
name: golden_toolkit
sha256: "8f74adab33154fe7b731395782797021f97d2edc52f7bfb85ff4f1b5c4a215f0"
url: "https://pub.dev"
source: hosted
version: "0.15.0"
http: http:
dependency: "direct main" dependency: "direct main"
description: description:
name: http name: http
sha256: d4872660c46d929f6b8a9ef4e7a7eff7e49bbf0c4ec3f385ee32df5119175139 sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.1.2" version: "1.2.1"
http_parser: http_parser:
dependency: transitive dependency: transitive
description: description:
@ -131,22 +123,38 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "4.0.2" version: "4.0.2"
js: leak_tracker:
dependency: transitive dependency: transitive
description: description:
name: js name: leak_tracker
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.6.7" 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: lints:
dependency: transitive dependency: transitive
description: description:
name: lints name: lints
sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.0" version: "4.0.0"
logging: logging:
dependency: "direct main" dependency: "direct main"
description: description:
@ -161,63 +169,71 @@ packages:
path: ".." path: ".."
relative: true relative: true
source: path source: path
version: "3.0.0" version: "3.1.1"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
name: matcher name: matcher
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.12.16" version: "0.12.16+1"
material_color_utilities: material_color_utilities:
dependency: transitive dependency: transitive
description: description:
name: material_color_utilities name: material_color_utilities
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.5.0" version: "0.8.0"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.10.0" version: "1.11.0"
mime:
dependency: transitive
description:
name: mime
sha256: "2e123074287cc9fd6c09de8336dae606d1ddb88d9ac47358826db698c176a1f2"
url: "https://pub.dev"
source: hosted
version: "1.0.5"
path: path:
dependency: "direct main" dependency: "direct main"
description: description:
name: path name: path
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.8.3" version: "1.9.0"
path_provider: path_provider:
dependency: "direct main" dependency: "direct main"
description: description:
name: path_provider name: path_provider
sha256: b27217933eeeba8ff24845c34003b003b2b22151de3c908d0e679e8fe1aa078b sha256: c9e7d3a4cd1410877472158bee69963a4579f78b68c65a2b7d40d1a7a88bb161
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.2" version: "2.1.3"
path_provider_android: path_provider_android:
dependency: transitive dependency: transitive
description: description:
name: path_provider_android name: path_provider_android
sha256: "477184d672607c0a3bf68fbbf601805f92ef79c82b64b4d6eb318cbca4c48668" sha256: a248d8146ee5983446bf03ed5ea8f6533129a12b11f12057ad1b4a67a2b3b41d
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.2.2" version: "2.2.4"
path_provider_foundation: path_provider_foundation:
dependency: transitive dependency: transitive
description: description:
name: path_provider_foundation name: path_provider_foundation
sha256: "19314d595120f82aca0ba62787d58dde2cc6b5df7d2f0daf72489e38d1b57f2d" sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.3.1" version: "2.4.0"
path_provider_linux: path_provider_linux:
dependency: transitive dependency: transitive
description: description:
@ -258,14 +274,22 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.8" version: "2.1.8"
pointycastle: shelf:
dependency: transitive dependency: "direct dev"
description: description:
name: pointycastle name: shelf
sha256: "7c1e5f0d23c9016c5bbd8b1473d0d3fb3fc851b876046039509e18e0c7485f2c" sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.7.3" version: "1.4.1"
shelf_static:
dependency: "direct dev"
description:
name: shelf_static
sha256: a41d3f53c4adf0f57480578c1d61d90342cd617de7fc8077b1304643c2d85c1e
url: "https://pub.dev"
source: hosted
version: "1.1.2"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter
@ -335,22 +359,30 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.4" 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: web:
dependency: transitive dependency: transitive
description: description:
name: web name: web
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.3.0" version: "0.5.1"
win32: win32:
dependency: transitive dependency: transitive
description: description:
name: win32 name: win32
sha256: "464f5674532865248444b4c3daca12bd9bf2d7c47f759ce2617986e7229494a8" sha256: "0eaf06e3446824099858367950a813472af675116bf63f008a4c2a75ae13e9cb"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "5.2.0" version: "5.5.0"
xdg_directories: xdg_directories:
dependency: transitive dependency: transitive
description: description:
@ -360,5 +392,5 @@ packages:
source: hosted source: hosted
version: "1.0.4" version: "1.0.4"
sdks: sdks:
dart: ">=3.2.0 <4.0.0" dart: ">=3.3.0 <4.0.0"
flutter: ">=3.16.0" flutter: ">=3.16.6"

View File

@ -23,7 +23,8 @@ dev_dependencies:
flutter_lints: flutter_lints:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
golden_toolkit: shelf:
shelf_static:
# For information on the generic Dart part of this file, see the # For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec # following page: https://dart.dev/tools/pub/pubspec

View File

@ -0,0 +1,9 @@
import 'dart:io';
import 'package:shelf/shelf_io.dart';
import 'package:shelf_static/shelf_static.dart';
void main() async {
var server = await serve(
createStaticHandler('build/web'), InternetAddress.loopbackIPv4, 0);
print('Listen on http://${server.address.host}:${server.port}/index.html');
}

View File

@ -7,16 +7,18 @@ class IntegerKeyframeAnimation extends KeyframeAnimation<int> {
@override @override
int getValue(Keyframe<int> keyframe, double keyframeProgress) { int getValue(Keyframe<int> keyframe, double keyframeProgress) {
if (keyframe.startValue == null || keyframe.endValue == null) { if (keyframe.startValue == null) {
throw Exception('Missing values for keyframe.'); throw Exception('Missing values for keyframe.');
} }
var endValue = keyframe.endValue ?? keyframe.startValue;
if (valueCallback != null) { if (valueCallback != null) {
var value = valueCallback!.getValueInternal( var value = valueCallback!.getValueInternal(
keyframe.startFrame, keyframe.startFrame,
keyframe.endFrame, keyframe.endFrame,
keyframe.startValue, keyframe.startValue,
keyframe.endValue, endValue,
keyframeProgress, keyframeProgress,
getLinearCurrentKeyframeProgress(), getLinearCurrentKeyframeProgress(),
progress); progress);
@ -25,7 +27,6 @@ class IntegerKeyframeAnimation extends KeyframeAnimation<int> {
} }
} }
return lerpDouble(keyframe.startValue, keyframe.endValue, keyframeProgress)! return lerpDouble(keyframe.startValue, endValue, keyframeProgress)!.round();
.round();
} }
} }

View File

@ -225,7 +225,8 @@ class LottieComposition {
fps ??= frameRate.framesPerSecond; fps ??= frameRate.framesPerSecond;
assert(!fps.isNaN && fps.isFinite && !fps.isNegative); assert(!fps.isNaN && fps.isFinite && !fps.isNegative);
var totalFrameCount = seconds * fps; var noOffsetDurationFrames = durationFrames + 0.01;
var totalFrameCount = (noOffsetDurationFrames / this.frameRate) * fps;
var frameIndex = (totalFrameCount * progress).toInt(); var frameIndex = (totalFrameCount * progress).toInt();
var roundedProgress = frameIndex / totalFrameCount; var roundedProgress = frameIndex / totalFrameCount;
assert(roundedProgress >= 0 && roundedProgress <= 1, assert(roundedProgress >= 0 && roundedProgress <= 1,

View File

@ -1,5 +1,7 @@
import 'dart:io' as io;
import 'dart:typed_data'; import 'dart:typed_data';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:http/http.dart' as http;
import '../lottie.dart'; import '../lottie.dart';
import 'composition.dart'; import 'composition.dart';
import 'l.dart'; import 'l.dart';
@ -95,7 +97,7 @@ class Lottie extends StatefulWidget {
/// Creates a widget that displays an [LottieComposition] obtained from a [File]. /// Creates a widget that displays an [LottieComposition] obtained from a [File].
static LottieBuilder file( static LottieBuilder file(
Object /*io.File|html.File*/ file, { io.File file, {
Animation<double>? controller, Animation<double>? controller,
FrameRate? frameRate, FrameRate? frameRate,
bool? animate, bool? animate,
@ -200,6 +202,8 @@ class Lottie extends StatefulWidget {
/// Creates a widget that displays an [LottieComposition] obtained from the network. /// Creates a widget that displays an [LottieComposition] obtained from the network.
static LottieBuilder network( static LottieBuilder network(
String url, { String url, {
http.Client? client,
Map<String, String>? headers,
Animation<double>? controller, Animation<double>? controller,
FrameRate? frameRate, FrameRate? frameRate,
bool? animate, bool? animate,
@ -225,6 +229,8 @@ class Lottie extends StatefulWidget {
}) => }) =>
LottieBuilder.network( LottieBuilder.network(
url, url,
client: client,
headers: headers,
controller: controller, controller: controller,
frameRate: frameRate, frameRate: frameRate,
animate: animate, animate: animate,

View File

@ -1,6 +1,8 @@
import 'dart:async'; import 'dart:async';
import 'dart:io' as io;
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:http/http.dart' as http;
import 'composition.dart'; import 'composition.dart';
import 'frame_rate.dart'; import 'frame_rate.dart';
import 'lottie.dart'; import 'lottie.dart';
@ -67,6 +69,7 @@ class LottieBuilder extends StatefulWidget {
/// Creates a widget that displays an [LottieComposition] obtained from the network. /// Creates a widget that displays an [LottieComposition] obtained from the network.
LottieBuilder.network( LottieBuilder.network(
String src, { String src, {
http.Client? client,
Map<String, String>? headers, Map<String, String>? headers,
this.controller, this.controller,
this.frameRate, this.frameRate,
@ -91,6 +94,7 @@ class LottieBuilder extends StatefulWidget {
this.renderCache, this.renderCache,
bool? backgroundLoading, bool? backgroundLoading,
}) : lottie = NetworkLottie(src, }) : lottie = NetworkLottie(src,
client: client,
headers: headers, headers: headers,
imageProviderFactory: imageProviderFactory, imageProviderFactory: imageProviderFactory,
decoder: decoder, decoder: decoder,
@ -107,7 +111,7 @@ class LottieBuilder extends StatefulWidget {
/// `android.permission.READ_EXTERNAL_STORAGE` permission. /// `android.permission.READ_EXTERNAL_STORAGE` permission.
/// ///
LottieBuilder.file( LottieBuilder.file(
Object /*io.File|html.File*/ file, { io.File file, {
this.controller, this.controller,
this.frameRate, this.frameRate,
this.animate, this.animate,

View File

@ -2,54 +2,54 @@ import 'dart:ui';
import 'value/drop_shadow.dart'; import 'value/drop_shadow.dart';
/// Property values are the same type as the generic type of their corresponding /// 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. /// of the callbacks.
/// ///
/// Supported properties: /// Supported properties:
/// Transform: /// Transform:
/// {@link #TRANSFORM_ANCHOR_POINT} /// {TRANSFORM_ANCHOR_POINT}
/// {@link #TRANSFORM_POSITION} /// {TRANSFORM_POSITION}
/// {@link #TRANSFORM_OPACITY} /// {TRANSFORM_OPACITY}
/// {@link #TRANSFORM_SCALE} /// {TRANSFORM_SCALE}
/// {@link #TRANSFORM_ROTATION} /// {TRANSFORM_ROTATION}
/// {@link #TRANSFORM_SKEW} /// {TRANSFORM_SKEW}
/// {@link #TRANSFORM_SKEW_ANGLE} /// {TRANSFORM_SKEW_ANGLE}
/// ///
/// Fill: /// Fill:
/// {@link #COLOR} (non-gradient) /// {#COLOR} (non-gradient)
/// {@link #OPACITY} /// {#OPACITY}
/// {@link #COLOR_FILTER} /// {#COLOR_FILTER}
/// ///
/// Stroke: /// Stroke:
/// {@link #COLOR} (non-gradient) /// {#COLOR} (non-gradient)
/// {@link #STROKE_WIDTH} /// {#STROKE_WIDTH}
/// {@link #OPACITY} /// {#OPACITY}
/// {@link #COLOR_FILTER} /// {#COLOR_FILTER}
/// ///
/// Ellipse: /// Ellipse:
/// {@link #POSITION} /// {#POSITION}
/// {@link #ELLIPSE_SIZE} /// {#ELLIPSE_SIZE}
/// ///
/// Polystar: /// Polystar:
/// {@link #POLYSTAR_POINTS} /// {#POLYSTAR_POINTS}
/// {@link #POLYSTAR_ROTATION} /// {#POLYSTAR_ROTATION}
/// {@link #POSITION} /// {#POSITION}
/// {@link #POLYSTAR_INNER_RADIUS} (star) /// {#POLYSTAR_INNER_RADIUS} (star)
/// {@link #POLYSTAR_OUTER_RADIUS} /// {#POLYSTAR_OUTER_RADIUS}
/// {@link #POLYSTAR_INNER_ROUNDEDNESS} (star) /// {#POLYSTAR_INNER_ROUNDEDNESS} (star)
/// {@link #POLYSTAR_OUTER_ROUNDEDNESS} /// {#POLYSTAR_OUTER_ROUNDEDNESS}
/// ///
/// Repeater: /// Repeater:
/// All transform properties /// All transform properties
/// {@link #REPEATER_COPIES} /// {#REPEATER_COPIES}
/// {@link #REPEATER_OFFSET} /// {#REPEATER_OFFSET}
/// {@link #TRANSFORM_ROTATION} /// {#TRANSFORM_ROTATION}
/// {@link #TRANSFORM_START_OPACITY} /// {#TRANSFORM_START_OPACITY}
/// {@link #TRANSFORM_END_OPACITY} /// {#TRANSFORM_END_OPACITY}
/// ///
/// Layers: /// Layers:
/// All transform properties /// All transform properties
/// {@link #TIME_REMAP} (composition layers only) /// {#TIME_REMAP} (composition layers only)
abstract class LottieProperty { abstract class LottieProperty {
/// ColorInt **/ /// ColorInt **/
static const Color color = Color(0x00000001); static const Color color = Color(0x00000001);

View File

@ -66,7 +66,7 @@ class Buffer {
} }
/// Reads and discards {@code byteCount} bytes from this source. Throws an /// 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. /// requested bytes can be skipped.
void skip(int byteCount) { void skip(int byteCount) {
_start += byteCount; _start += byteCount;

View File

@ -857,7 +857,7 @@ class JsonUtf8Reader extends JsonReader {
/// Returns the next character in the stream that is neither whitespace nor a /// 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 /// part of a comment. When this returns, the returned character is always at
/// {@code buffer.getByte(0)}. /// {buffer.getByte(0)}.
int _nextNonWhitespace(bool throwOnEof) { int _nextNonWhitespace(bool throwOnEof) {
// This code uses ugly local variables 'p' and 'l' representing the 'pos' // This code uses ugly local variables 'p' and 'l' representing the 'pos'
// and 'limit' fields respectively. Using locals rather than fields saves // and 'limit' fields respectively. Using locals rather than fields saves

View File

@ -74,7 +74,7 @@ class AssetLottie extends LottieProvider {
} }
@override @override
bool operator ==(dynamic other) { bool operator ==(Object other) {
if (other.runtimeType != runtimeType) return false; if (other.runtimeType != runtimeType) return false;
return other is AssetLottie && return other is AssetLottie &&
other.keyName == keyName && other.keyName == keyName &&

View File

@ -1,12 +1,13 @@
import 'dart:io' as io;
import 'dart:ui' as ui; import 'dart:ui' as ui;
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:path/path.dart' as p;
import '../composition.dart'; import '../composition.dart';
import '../lottie_image_asset.dart'; import '../lottie_image_asset.dart';
import 'load_fonts.dart'; import 'load_fonts.dart';
import 'load_image.dart'; import 'load_image.dart';
import 'lottie_provider.dart'; import 'lottie_provider.dart';
import 'provider_io.dart' if (dart.library.html) 'provider_web.dart' as io;
@immutable @immutable
class FileLottie extends LottieProvider { class FileLottie extends LottieProvider {
@ -15,9 +16,13 @@ class FileLottie extends LottieProvider {
super.imageProviderFactory, super.imageProviderFactory,
super.decoder, super.decoder,
super.backgroundLoading, super.backgroundLoading,
}); }) : assert(
!kIsWeb,
'Lottie.file is not supported on Flutter Web. '
'Consider using either Lottie.asset or Lottie.network instead.',
);
final Object /*io.File|html.File*/ file; final io.File file;
@override @override
Future<LottieComposition> load({BuildContext? context}) { Future<LottieComposition> load({BuildContext? context}) {
@ -25,9 +30,9 @@ class FileLottie extends LottieProvider {
LottieComposition composition; LottieComposition composition;
var args = (file, decoder); var args = (file, decoder);
if (backgroundLoading) { if (backgroundLoading) {
composition = await compute(loadFileAndParse, args); composition = await compute(_loadFileAndParse, args);
} else { } else {
composition = await loadFileAndParse(args); composition = await _loadFileAndParse(args);
} }
for (var image in composition.images.values) { for (var image in composition.images.values) {
@ -44,26 +49,28 @@ class FileLottie extends LottieProvider {
LottieComposition composition, LottieImageAsset lottieImage) { LottieComposition composition, LottieImageAsset lottieImage) {
var imageProvider = getImageProvider(lottieImage); var imageProvider = getImageProvider(lottieImage);
imageProvider ??= io.loadImageForFile(file, lottieImage); var imagePath = p.url
.join(p.dirname(file.path), lottieImage.dirName, lottieImage.fileName);
imageProvider ??= FileImage(io.File(imagePath));
return loadImage(composition, lottieImage, imageProvider); return loadImage(composition, lottieImage, imageProvider);
} }
@override @override
bool operator ==(dynamic other) { bool operator ==(Object other) {
if (other.runtimeType != runtimeType) return false; if (other.runtimeType != runtimeType) return false;
return other is FileLottie && io.areFilesEqual(file, other.file); return other is FileLottie && file.path == other.file.path;
} }
@override @override
int get hashCode => file.hashCode; int get hashCode => file.hashCode;
@override @override
String toString() => '$runtimeType(file: ${io.filePath(file)})'; String toString() => '$runtimeType(file: ${file.path})';
} }
Future<LottieComposition> loadFileAndParse( Future<LottieComposition> _loadFileAndParse(
(Object, LottieDecoder?) args) async { (io.File, LottieDecoder?) args) async {
var bytes = await io.loadFile(args.$1); var bytes = await args.$1.readAsBytes();
return await LottieComposition.fromBytes(bytes, decoder: args.$2); return await LottieComposition.fromBytes(bytes, decoder: args.$2);
} }

View File

@ -50,7 +50,7 @@ class MemoryLottie extends LottieProvider {
} }
@override @override
bool operator ==(dynamic other) { bool operator ==(Object other) {
if (other.runtimeType != runtimeType) return false; if (other.runtimeType != runtimeType) return false;
//TODO(xha): compare bytes content //TODO(xha): compare bytes content

View File

@ -2,24 +2,26 @@ import 'dart:async';
import 'dart:ui' as ui; import 'dart:ui' as ui;
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:http/http.dart' as http;
import 'package:path/path.dart' as p; import 'package:path/path.dart' as p;
import '../composition.dart'; import '../composition.dart';
import '../lottie_image_asset.dart'; import '../lottie_image_asset.dart';
import 'load_fonts.dart'; import 'load_fonts.dart';
import 'load_image.dart'; import 'load_image.dart';
import 'lottie_provider.dart'; import 'lottie_provider.dart';
import 'provider_io.dart' if (dart.library.html) 'provider_web.dart' as network;
@immutable @immutable
class NetworkLottie extends LottieProvider { class NetworkLottie extends LottieProvider {
NetworkLottie( NetworkLottie(
this.url, { this.url, {
this.client,
this.headers, this.headers,
super.imageProviderFactory, super.imageProviderFactory,
super.decoder, super.decoder,
super.backgroundLoading, super.backgroundLoading,
}); });
final http.Client? client;
final String url; final String url;
final Map<String, String>? headers; final Map<String, String>? headers;
@ -28,21 +30,30 @@ class NetworkLottie extends LottieProvider {
return sharedLottieCache.putIfAbsent(this, () async { return sharedLottieCache.putIfAbsent(this, () async {
var resolved = Uri.base.resolve(url); var resolved = Uri.base.resolve(url);
LottieComposition composition; var client = this.client ?? http.Client();
var args = (resolved, headers, decoder); try {
if (backgroundLoading) { var bytes = await client.readBytes(resolved, headers: headers);
composition = await compute(downloadAndParse, args);
} else { LottieComposition composition;
composition = await downloadAndParse(args); if (backgroundLoading) {
composition = await compute(parseJsonBytes, (bytes, decoder));
} else {
composition =
await LottieComposition.fromBytes(bytes, decoder: decoder);
}
for (var image in composition.images.values) {
image.loadedImage ??= await _loadImage(resolved, composition, image);
}
await ensureLoadedFonts(composition);
return composition;
} finally {
if (this.client == null) {
client.close();
}
} }
for (var image in composition.images.values) {
image.loadedImage ??= await _loadImage(resolved, composition, image);
}
await ensureLoadedFonts(composition);
return composition;
}); });
} }
@ -60,7 +71,7 @@ class NetworkLottie extends LottieProvider {
} }
@override @override
bool operator ==(dynamic other) { bool operator ==(Object other) {
if (other.runtimeType != runtimeType) return false; if (other.runtimeType != runtimeType) return false;
return other is NetworkLottie && return other is NetworkLottie &&
other.url == url && other.url == url &&
@ -73,9 +84,3 @@ class NetworkLottie extends LottieProvider {
@override @override
String toString() => '$runtimeType(url: $url)'; String toString() => '$runtimeType(url: $url)';
} }
Future<LottieComposition> downloadAndParse(
(Uri, Map<String, String>?, LottieDecoder?) args) async {
var bytes = await network.loadHttp(args.$1, headers: args.$2);
return await LottieComposition.fromBytes(bytes, decoder: args.$3);
}

View File

@ -1,44 +0,0 @@
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:path/path.dart' as p;
import '../lottie_image_asset.dart';
final HttpClient _sharedHttpClient = HttpClient()..autoUncompress = false;
Future<Uint8List> loadHttp(Uri uri, {Map<String, String>? headers}) async {
var request = await _sharedHttpClient.getUrl(uri);
headers?.forEach((String name, String value) {
request.headers.add(name, value);
});
final response = await request.close();
if (response.statusCode != HttpStatus.ok) {
throw Exception('Http error. Status code: ${response.statusCode} for $uri');
}
final bytes = await consolidateHttpClientResponseBytes(response);
if (bytes.lengthInBytes == 0) {
throw Exception('NetworkImage is an empty file: $uri');
}
return bytes;
}
Future<Uint8List> loadFile(Object file) {
return (file as File).readAsBytes();
}
bool areFilesEqual(Object f1, Object f2) =>
(f1 as File).path == (f2 as File).path;
String filePath(Object file) {
return (file as File).path;
}
ImageProvider loadImageForFile(Object file, LottieImageAsset lottieImage) {
var fileIo = file as File;
var imagePath = p.url
.join(p.dirname(fileIo.path), lottieImage.dirName, lottieImage.fileName);
return FileImage(File(imagePath));
}

View File

@ -1,39 +0,0 @@
import 'dart:html';
import 'dart:typed_data';
import 'package:flutter/rendering.dart';
import '../lottie_image_asset.dart';
// ignore_for_file: avoid_web_libraries_in_flutter
Future<Uint8List> loadHttp(Uri uri, {Map<String, String>? headers}) async {
var request = await HttpRequest.request(uri.toString(),
requestHeaders: headers, responseType: 'blob');
return _loadBlob(request.response as Blob);
}
Future<Uint8List> loadFile(Object file) {
return _loadBlob(file as File);
}
Future<Uint8List> _loadBlob(Blob file) async {
var reader = FileReader();
reader.readAsArrayBuffer(file);
await reader.onLoadEnd.first;
if (reader.readyState != FileReader.DONE) {
throw Exception('Error while reading blob');
}
return reader.result! as Uint8List;
}
String filePath(Object file) {
return (file as File).relativePath ?? '';
}
bool areFilesEqual(Object f1, Object f2) => f1 == f2;
ImageProvider loadImageForFile(Object file, LottieImageAsset lottieImage) {
throw UnimplementedError();
}

View File

@ -96,7 +96,7 @@ class MiscUtils {
/// it to the accumulator list. /// it to the accumulator list.
/// ///
/// Any {@link KeyPathElementContent} should call through to this as its implementation of /// 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( static void resolveKeyPath(
KeyPath keyPath, KeyPath keyPath,
int depth, int depth,

View File

@ -331,7 +331,7 @@ class ResolvedValueDelegate<T> {
/// to multiple contents. In that case, the callbacks's value will apply to all of them. /// to multiple contents. In that case, the callbacks's value will apply to all of them.
/// <p> /// <p>
/// Internally, this will check if the {@link KeyPath} has already been resolved with /// 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) { void addValueCallback(LottieDrawable drawable) {
var invalidate = false; var invalidate = false;
if (valueDelegate.keyPath.isEmpty) { if (valueDelegate.keyPath.isEmpty) {

View File

@ -5,34 +5,34 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: _fe_analyzer_shared name: _fe_analyzer_shared
sha256: eb376e9acf6938204f90eb3b1f00b578640d3188b4c8a8ec054f9f479af8d051 sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "64.0.0" version: "67.0.0"
analyzer: analyzer:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: analyzer name: analyzer
sha256: "69f54f967773f6c26c7dcb13e93d7ccee8b17a641689da39e878d5cf13b06893" sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "6.2.0" version: "6.4.1"
archive: archive:
dependency: "direct main" dependency: "direct main"
description: description:
name: archive name: archive
sha256: "22600aa1e926be775fa5fe7e6894e7fb3df9efda8891c73f70fb3262399a432d" sha256: ecf4273855368121b1caed0d10d4513c7241dfc813f7d3c8933b36622ae9b265
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.4.10" version: "3.5.1"
args: args:
dependency: transitive dependency: transitive
description: description:
name: args name: args
sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.4.2" version: "2.5.0"
async: async:
dependency: transitive dependency: transitive
description: description:
@ -93,10 +93,10 @@ packages:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: dart_style name: dart_style
sha256: "40ae61a5d43feea6d24bd22c0537a6629db858963b99b4bc1c3db80676f32368" sha256: "99e066ce75c89d6b29903d788a7bb9369cf754f7b24bf70bf4b6d6d6b26853b9"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.3.4" version: "2.3.6"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
@ -122,10 +122,10 @@ packages:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: flutter_lints name: flutter_lints
sha256: e2a421b7e59244faef694ba7b30562e489c2b489866e505074eb005cd7060db7 sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.1" version: "4.0.0"
flutter_test: flutter_test:
dependency: "direct dev" dependency: "direct dev"
description: flutter description: flutter
@ -139,46 +139,78 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.2" version: "2.1.2"
js: http:
dependency: transitive dependency: "direct main"
description: description:
name: js name: http
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.6.7" version: "1.2.1"
http_parser:
dependency: transitive
description:
name: http_parser
sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b"
url: "https://pub.dev"
source: hosted
version: "4.0.2"
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: lints:
dependency: transitive dependency: transitive
description: description:
name: lints name: lints
sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.0" version: "4.0.0"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
name: matcher name: matcher
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.12.16" version: "0.12.16+1"
material_color_utilities: material_color_utilities:
dependency: transitive dependency: transitive
description: description:
name: material_color_utilities name: material_color_utilities
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.5.0" version: "0.8.0"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.10.0" version: "1.11.0"
package_config: package_config:
dependency: transitive dependency: transitive
description: description:
@ -191,18 +223,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: path name: path
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.8.3" version: "1.9.0"
pointycastle:
dependency: transitive
description:
name: pointycastle
sha256: "7c1e5f0d23c9016c5bbd8b1473d0d3fb3fc851b876046039509e18e0c7485f2c"
url: "https://pub.dev"
source: hosted
version: "3.7.3"
pub_semver: pub_semver:
dependency: transitive dependency: transitive
description: description:
@ -280,6 +304,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.4" 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: watcher:
dependency: transitive dependency: transitive
description: description:
@ -292,10 +324,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: web name: web
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.3.0" version: "0.5.1"
yaml: yaml:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -305,5 +337,5 @@ packages:
source: hosted source: hosted
version: "3.1.2" version: "3.1.2"
sdks: sdks:
dart: ">=3.2.0 <4.0.0" dart: ">=3.3.0 <4.0.0"
flutter: ">=3.16.0" flutter: ">=3.16.0"

View File

@ -1,10 +1,11 @@
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: 3.0.0 version: 3.1.1
repository: https://github.com/xvrh/lottie-flutter repository: https://github.com/xvrh/lottie-flutter
funding: funding:
- https://www.buymeacoffee.com/xvrh - https://www.buymeacoffee.com/xvrh
- https://github.com/sponsors/xvrh
environment: environment:
sdk: '^3.2.0' sdk: '^3.2.0'
@ -14,6 +15,7 @@ dependencies:
archive: ^3.0.0 archive: ^3.0.0
flutter: flutter:
sdk: flutter sdk: flutter
http: ^1.0.0
path: ^1.8.0 path: ^1.8.0
vector_math: ^2.1.0 vector_math: ^2.1.0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB