layoutBuilder property

AnimatedCrossFadeBuilder layoutBuilder
final

A builder that positions the firstChild and secondChild widgets.

The widget returned by this method is wrapped in an AnimatedSize.

By default, this uses AnimatedCrossFade.defaultLayoutBuilder, which uses a Stack and aligns the bottomChild to the top of the stack while providing the topChild as the non-positioned child to fill the provided constraints. This works well when the AnimatedCrossFade is in a position to change size and when the children are not flexible. However, if the children are less fussy about their sizes (for example a CircularProgressIndicator inside a Center), or if the AnimatedCrossFade is being forced to a particular size, then it can result in the widgets jumping about when the cross-fade state is changed.

Implementation

final AnimatedCrossFadeBuilder layoutBuilder