-
Notifications
You must be signed in to change notification settings - Fork 56
Description
Is there an existing feature request for this?
- I have searched the existing issues.
Command
pump one widget, and then another
Description
I've been trying to test a few animated widgets which produce an animation based on changes to its properties. They are very similar to Flutter's own animated widgets. Take AnimatedOpacity for example. At first, when AnimatedOpacity is built, its child is built with the specified opacity. Then, if it is built again with a different value for opacity, an animation is performed where the opacity level changes from the original to the new value.
Testing this widget would require me to pump it with one value for opacity and then pump it again with a different value. I've tried using goldenTest.pumpWidget with something like:
pumpWidget: (tester, widget) {
tester.pumpWidget(widget);
tester.pumpWidget(AnimatedOpacity(opacity: newValue, child: (widget as AnimatedOpacity).child));
},But the widget received by pumpWidget is an Alchemist wrapper around AnimatedOpacity, and not just an AnimatedOpacity widget.
Reasoning
This is a basic type of animation used even by Flutter's own animated widgets. It would be nice to be able to test these with Alchemist.
Additional context and comments
Is there currently a way in which this could work with Alchemist as is? Or what kind of change would it make sense to implement in Alchemist to make tests such as this possible?