Skip to Content
API ReferenceAnimatedContainer

AnimatedContainer

A container element whose visual properties animate implicitly when they change between builds. Any property that differs from its previous value will smoothly tween to the new target over Duration. This is a convenience wrapper over ImplicitAnimation for the common case of animating container decoration, size, and padding.

Constructor

AnimatedContainer

Creates a new animated container.

ParameterDescription
durationDuration of one full tween in seconds. Must be greater than zero.
childThe child element to render inside this container.
decorationOptional visual decoration to animate toward.
widthOptional target width in logical pixels.
heightOptional target height in logical pixels.
paddingOptional target inner padding.
curveThe easing curve to apply. Defaults to linear when null.
keyAn optional key for reconciliation identity.

Properties

Child

The child element rendered inside this container.

Curve

The easing curve applied to the animation progress. Defaults to Linear when null.

Decoration

The visual decoration to animate toward.

Duration

Duration of one full tween in seconds. Must be greater than zero.

Height

The target height in logical pixels.

Padding

The target inner padding.

Width

The target width in logical pixels.

Methods

Build

Last updated on