Closed tguerin closed 8 months ago
Name | Link |
---|---|
Latest commit | f1c92d17040d35f26d65cf05702a0f21c2a3379d |
Latest deploy log | https://app.netlify.com/sites/imaginative-palmier-d7ee2c/deploys/6548066ca34211000886f65f |
@Joshix-1 wdyt? Does it fix your issue? Need to clean the code btw.
I feel like the solution of only allowing either dynamically added via NewtonState or fixed added via Newton arg is a better solution. Or maybe have two different widgets for each use case. This feels like it's getting too complex
As i said, i'm totally fine removing the runtime version and stick to the effects passed as parameters. Will remove the runtime support. Thanks for your time!
that's not what I meant.
My use case is to have an effect on button press. That's not really possible with the effects passed as parameters. But I don't need both in the same widgets. That are two different use-cases that could be split into two widgets or one widget that only supports one of them at the time.
What I do:
I have a globalKey that I set as the key of the Newton
widget.
GlobalKey<NewtonState> _newtonKey = GlobalKey();
And on button press / other event I run _newtonState.addEffect(...)
that works if the state isn't cleared. The effect gets added only temporary and then gets removed.
ah got it!
I reworked the PR and updated the description. I don't think we need 2 different widgets. A Newton widget can accept effects added at runtime howevert they must be removed at runtime (or automatically removed if there is a finite particle count). Still draft cause I need to test it properly.
Code looks good
This pr aims to improve 3 things: