-
Notifications
You must be signed in to change notification settings - Fork 476
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
Show only last frame when widget is created #59
Comments
That's interesting, and a good point! A heavy way to do this right now is using a custom controller. For ease of use, I think we might be able to introduce an optional isAnimated (defaults to true) argument that might help. When it is false, the last frame of the current animation(s) is directly applied. |
I pushed a branch with an example, it's called snap_to_end: https://github.com/2d-inc/Flare-Flutter/tree/snap_to_end It includes an example that implements this (note it doesn't animate when you open the settings page): Try it out and let me know if it fits your use case. If it does, we can publish an updated package! |
Hi @luigi-rosso thanks for this ! from the GIF look like it does the job great ! let me try this ! |
Ok just tested in this branch https://github.com/jaumard/flare_checkbox/tree/bug/noOn look like it work !!! but on hot reload I have a glitch, first it show the first frame, and them jump to the last one. Not a big deal if it's just during hot reload but I wanted to report it anyway :) Thanks ! let me know when it's released ! I'll update my package for my #FlutterCreate ^^ |
I published this as 1.3.5, I did see the reload issue but that'll require some more fundamental reworking of FlareActor (which I do want to do) such that it applies changes on the current frame, but that'll take a little more time. |
Thanks! I let you decide if you want to close the issue or keep it open for this reworking ;) |
flare_checkbox 1.0.1 include snapToEnd now 👌 |
I'm checking this https://github.com/2d-inc/Flare-Flutter/blob/master/example/favorite/lib/buttons_row.dart#L51 and I did the same on my flare_checkbox but for a checkbox you may don't want to animate the state when the widget is show for the first time. For example if state is false, playing the off animation when the widget is shown looks weird. So I'm searching a way to only show the last frame when the widget is shown, and on click play the right animation depending on the state.
Any idea how can I implement this ?
The text was updated successfully, but these errors were encountered: