Do a fade and size transition between two widgets.
Show and hide a widget, by resizing it vertically while fading.
Size and Fade
To do a fade and size transition when you change the child widget,
the "old" and the "new" child must have the same width,
but can have different heights,
and you don't need to know their sizes in advance.
You can also define a duration and curve for both the fade and the size, separately.
Important: If the "new" child is the same widget type as the "old" child, but with different
parameters, then AnimatedSizeAndFade will NOT do a transition between them, since as far as
the framework is concerned, they are the same widget, and the existing widget can be updated with
the new parameters. To force the transition to occur, set a Key (typically a ValueKey
taking any widget data that would change the visual appearance of the widget) on each child widget
that you wish to be considered unique.
With AnimatedCrossFade you must provide both the firstChild and secondChild
at the same time, but with AnimatedSizeAndFade you may simply change its child.
With AnimatedSwitcher you may simply change its child, but then it only animates
the fade, not the size.
AnimatedContainer only works if you know the size of the children in advance.