-
Notifications
You must be signed in to change notification settings - Fork 86
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
Fade out then fade in results in invisible widget #54
Comments
From the README:
This specific scenario (fade out then in) is the only one I've run into that causes real difficulties due to this. Still thinking about ways to make this easier. |
Actually, I'm going to leave this open as a discussion thread on ways to improve this. |
Thinking out loud here, but one way to deal with this is to make FadeEffect aware of previous effects. This isn't trivial, and would likely require:
With the above, a It also seems like a lot of architecture to solve this one scenario. |
Another option would be a purpose built effect
This is a lot simpler to implement and a lot more contained (doesn't require any broad architecture changes), but has a couple drawbacks:
|
One more, that I don't think I like at all, but am writing up for reference: Add a setting to
This has the major flaw that it doesn't work if the fades aren't directly adjacent (ex. if there's a |
Thanks, @gskinner – I hadn't noticed that in the README. The suggested approach works fine for me – I'm actually only partially fading out and back in again, rather than fading all the way to 0/1. |
@gskinner I think it's not just fade where that causes a problem. An analogous problem occurs when you do scale (say from 1 to 1.1, then from 1.1 to 1). I ended up with a weird scale (which wasn't 1). To create a set of buttons with a "button effect" of scaling out/in when pushed, I had to do something arduous like: ...[1, 2, 3, 4, 5, 6, 7, 8, 9, 0].map((e) {
ElevatedButton(
onPressed: () {
setState(() {
selectedButton = e;
});
// Do work
},
child: Text('$e')
).animate(
target: selectedButton == e ? 1 : 0,
effects: buttonPushAnimation)) Where I need the whole Because of the problem you link to in #54 (comment)
The combination of the resetting of |
In fact, I wonder if we couldn't extend
(with the idea being that it can "reset" its internal state so that I can touch the button repeatedly and repeat the animation) |
is still no way to do that situation: |
@eggcaker - just switch your effect when you switch the button label from a fadeOut to a fadeIn. |
is any demo for this ? no idea how to do this |
I am encountering this when trying to build a custom clipper effect to be used with EDIT: I took a step back to rethink and turns out I was using the wrong tool for the job. Rive covered my scenario perfectly. |
Hi – I'm noticing that following a fade out with a fade in, results in the widget not appearing at all.
The other way around, fading in and then out, seems to work as expected.
The text was updated successfully, but these errors were encountered: