Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Base: #285 by @onlymice
What does this change?
Adds lottie integration.
Checks for lottie files by in json tags
Example includes on how to use it
Docs changed accordingly
Related
Initial Feature Request: #47
Previous PR that tried to introduce support for Lottie: #70
What's different now?
Previously HiroyukiTamura #70 implemented a Lottie integration per request #47 (comment) but as stated by britannio's #70 (comment) in the initial PR, their implementation will be better off checking for keys in the file itself, rather than only it's extension
*_lottie.json
as it was initially requested two years ago.So I did.
Other issues
Why there is a lot of changes to tests
Initially Implementation of this feature required File read access, there was no issues with that if you run code as designed e.g
But if you try to run tests you might ended up seeing that the relative asset path that you get in
isSupport
is not relative to theDirectory.current.path
and the code in'packages/core/lib'
can't access it while running tests.So I introduced mocked
rootPath
#assets_gen_integrations_test.dart#L13 for tests and now the AssetType has field forabsolutePath
that is constructed from the passed rootPath (config.rootPath
) and the key/path
.Other integrations haven't tried to read files, cause they don't need it, so here we are, feel free to propose a better solution.
What is the value of this and can you measure success?
Measure
Pass tests.
No linting issues with generated code.
Example runs, plays the animation and works well.
Value