A widget that cross-fades between two given children and animates itself between their sizes.

The animation is controlled through the crossFadeState parameter. firstCurve and secondCurve represent the opacity curves of the two children. Note that firstCurve is inverted, i.e. it fades out when providing a growing curve like Curves.linear. sizeCurve is the curve used to animated between the size of the fading out child and the size of the fading in child.

This widget is intended to be used to fade a pair of widgets with the same width. In the case where the two children have different heights, the animation crops overflowing children during the animation by aligning their top edge, which means that the bottom will be clipped.

Inheritance

Constructors

AnimatedCrossFade({Key key, Widget firstChild, Widget secondChild, Curve firstCurve: Curves.linear, Curve secondCurve: Curves.linear, Curve sizeCurve: Curves.linear, @required CrossFadeState crossFadeState, @required Duration duration })

Creates a cross-fade animation widget.

Properties

crossFadeState CrossFadeState

The child that will be shown when the animation has completed.

read-only
duration Duration

The duration of the whole orchestrated animation.

read-only
firstChild Widget

The child that is visible when crossFadeState is showFirst. It fades out when transitioning from showFirst to showSecond and vice versa.

read-only
firstCurve Curve

The fade curve of the first child.

read-only
secondChild Widget

The child that is visible when crossFadeState is showSecond. It fades in when transitioning from showFirst to showSecond and vice versa.

read-only
secondCurve Curve

The fade curve of the second child.

read-only
sizeCurve Curve

The curve of the animation between the two children's sizes.

read-only
hashCode int

Get a hash code for this object.

read-only, inherited
key Key

Controls how one widget replaces another widget in the tree.

read-only, inherited
runtimeType Type

A representation of the runtime type of the object.

read-only, inherited

Operators

operator ==(other) bool

The equality operator.

inherited

Methods

createState() → _AnimatedCrossFadeState

Creates the mutable state for this widget at a given location in the tree.

createElement() StatefulElement

Creates a StatefulElement to manage this widget's location in the tree.

inherited
debugFillDescription(List<String> description) → void

Add additional information to the given description for use by toString.

inherited
noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited
toString() String

Returns a string representation of this object.

inherited
toStringShort() String

A short, textual description of this widget.

inherited