Comments (4)
Can you try using callback
instead of value
in the delegate.
example:
ValueDelegate.gradientColor(
const ['灯光', '灯光', 'Gradient Fill 2'],
callback: (_) => [colorList[i], Colors.white],
),
Let me know if it helps.
from lottie-flutter.
@xvrh
I try to replace this code:
ValueDelegate.gradientColor(
const ['灯光', '灯光', 'Gradient Fill 2'],
callback: (_) => [colorList[i], Colors.white],
),
but it can not helps.
from lottie-flutter.
It seems there is a bug in the update of the gradient.
In the mean time to unblock you, you can set a key in the Lottie widget like this:
@override
Widget build(BuildContext context) {
return Lottie.asset(
'assets/blub.json',
key: ValueKey(i),
delegates: LottieDelegates(
text: (initialText) => '**$initialText**',
values: [
ValueDelegate.color(
const ['灯泡', '灯泡', '填充 1'],
value: colorList[i],
),
ValueDelegate.gradientColor(
const ['灯台', '灯台', 'Gradient Fill 1'],
value: [Colors.black, Colors.grey],
),
ValueDelegate.gradientColor(
const ['灯光', '灯光', 'Gradient Fill 2'],
value: [colorList[i], Colors.white],
),
],
),
);
}
from lottie-flutter.
@xvrh
Thank you! It is helpful that set a key.
from lottie-flutter.
Related Issues (20)
- add flutter 3.16 proper support and update dependencies HOT 2
- ValueDelegate.position can not change images
- Using this library will use a lot of GPUs, even if `enableRenderCache` has been used HOT 2
- Valid json with missing frames HOT 1
- Black lines appear when one animation overlaps another one
- how to Cache tgs file . HOT 1
- tgs lottie very slow on android HOT 5
- How should I playsegment? HOT 2
- RenderCache as Raster initializes animation with incorrect state HOT 1
- How to disable the implementation of auto-orient?
- Privacy Manifest file for IOS HOT 2
- Screen Stuck when try to load the lottie in flutter web
- The lottie files downloaded from lottiefiles can not render HOT 34
- lottie.netowkr how to cached?
- can't load json animation HOT 4
- The CPU usage is especially high HOT 2
- Lottie not working in web since 3.1.2 HOT 6
- .lottie file not working on iOS HOT 1
- How can I let the click or slide event penetrate the lottie animation? HOT 2
- Not working on Windows 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lottie-flutter.