-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimized Watch #318
Comments
Oh interesting thought! Could you share some pseudo code as an example? The image widget is a good example use case for sure. |
Just fall for it this morning. Nothing I can share cause code is not public but the concept is exactly the same than I've a dedicated widget that just received a Watch in the Tree and everything start blinking because each update force the reload of asset and transformation is then applied to the whole context. Want I want is just passing the child that is cached into memory and apply transformation. As an alternative I can rely on ForegroundPainter but our case with Watch is more ubiquitous and even more dangerous if relying on signal animation capacities. I wish I can show you what I've done with Signals it's beyond anything else I've done before ^^ |
Oh i see! I can add an optional child property to the builder! Sounds super amazing! I am also working with painters and transforms with signals, but I usually use the painter + custom multi child delegate: |
Yep I'm following your commits, I know it is one of your special objective :) |
Ah no I did not saw this one :D Are you aiming for a Blender Geometry Node tool? You know I'm a big aficionado of coding my photos filter myself? |
Thanks! It will be a package that anyone can define custom nodes and the package will handle all the interaction state. All possible because of signals! |
The flow image editor app I want to open source and allow for contributions to custom nodes and filters! |
Not the place to discuss it but if Dart is more than qualified to be the front To my little hands down experience https://github.com/libvips/libvips is the way to go. Just the 2 cents of a LUT creator ;) |
Oh that's awesome! And yeah I was meaning more for the nodes for creating a pipeline that is not really realtime. The flow image editor only runs each operation when each dependency changes using a computed so it would I guess run the LUT once and cache it. But yeah we can chat more offline 😎 |
I looked into this briefly.. For high performance animations / widget caching, Flutter uses a different function signature for the builders in
Whereas
Adding an additional I wonder what the smoothest way to add a Adding an optional |
Since we are launching v6 I think it would be a perfect time to change the signature. I do know it would be a breaking change for anyone using it but we might could offer a codemod? The alternative would be to add a named constructor and it could be ignored for the others (my preference). We could also add a new widget called WatchBuilder or something |
Break the signature, it won't be much a burden to update the code plus it will align with Flutter. If possible limit the number of constructors/widgets/methods to keep the API surface accessible. Others state-mngts felt for it and they're too complexe to learn or too specific while Signals may aim to be simple and accessible on first read. |
Sounds good! Will break it for v6. I think it is the right call and especially as we make it easier to work with ValueNotifier and Streams |
I'm reading your commits on 6.0! |
Decided on a new path. Create new widget Update Watch to use WatchBuilder internally. This will allow for an easy migration to v6 while in the future being able to deprecate one. |
After migrating to the testing branch I expressed some code as
As the second parameter is required even where child is not. |
The latest removes that from Watch and only puts it in WatchBuilder! |
It would be a nice addition to have
Watch
manage child widget to avoid full rebuild.It's possible with current API but we have to build the child outside and pass it to builder by context.
This can be a costly error for beginner who are unaware of the process.
The moment they start working with Asset like image the whole UI can start to blink.
Having a document
Widget? child
attribute would suffice to explain what's going onor and extended constructor around an existing child that would rebuild on signals update.
The text was updated successfully, but these errors were encountered: