AnimatedBuilder class

Animated Builder - 用于创建带动画的容器

A builder class for creating animated containers with Tailwind CSS-like transition utilities.

Example:

AnimatedBuilder(
  child: Text('Hello'),
)
  .duration(Duration(milliseconds: 300))
  .curve(Curves.easeInOut)
  .build()
Available extensions

Constructors

AnimatedBuilder({required Widget child})
Creates an AnimatedBuilder with the given child.

Properties

child Widget
The child widget
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

alignment(AlignmentGeometry? alignment) AnimatedBuilder
设置对齐
animateBounce() AnimatedBuilder

Available on AnimatedBuilder, provided by the AnimatedBuilderExtensions extension

animate-bounce - 弹跳动画 ⚠️ 部分支持:需要通过 AnimationController 实现 此方法返回一个带有弹跳动画的 Widget,需要使用 StatefulWidget 和 AnimationController
animatePing() AnimatedBuilder

Available on AnimatedBuilder, provided by the AnimatedBuilderExtensions extension

animate-ping - 脉冲动画(缩放和淡出) ⚠️ 部分支持:需要通过 AnimationController 实现 此方法返回一个带有脉冲动画的 Widget,需要使用 StatefulWidget 和 AnimationController
animatePulse() AnimatedBuilder

Available on AnimatedBuilder, provided by the AnimatedBuilderExtensions extension

animate-pulse - 脉冲动画(透明度变化) ⚠️ 部分支持:需要通过 AnimationController 实现 此方法返回一个带有脉冲动画的 Widget,需要使用 StatefulWidget 和 AnimationController
animateSpin() AnimatedBuilder

Available on AnimatedBuilder, provided by the AnimatedBuilderExtensions extension

animate-spin - 旋转动画 ⚠️ 部分支持:需要通过 AnimationController 实现 此方法返回一个带有旋转动画的 Widget,需要使用 StatefulWidget 和 AnimationController 示例:
build() AnimatedContainer
构建 AnimatedContainer widget
clipBehavior(Clip? clipBehavior) AnimatedBuilder
设置裁剪行为
constraints(BoxConstraints? constraints) AnimatedBuilder
设置约束
container(ContainerBuilder builder) AnimatedBuilder
设置容器样式(通过 ContainerBuilder) ⚠️ 注意:此方法当前不提取 ContainerBuilder 的属性 建议直接使用 width(), height(), padding() 等方法设置属性
curve(Curve curve) AnimatedBuilder
ease-{type} - 设置动画曲线 ✅ 支持:通过 Curve 实现
decoration(Decoration? decoration) AnimatedBuilder
设置装饰
delay(Duration delay) AnimatedBuilder
delay-{time} - 设置动画延迟时间 ⚠️ 部分支持:Flutter 中需要通过 Future.delayed 或 AnimationController 实现 此方法设置延迟值,但实际延迟需要在 StatefulWidget 中使用 AnimationController 实现
delay100() AnimatedBuilder
delay-100 - 100ms 延迟
delay1000() AnimatedBuilder
delay-1000 - 1000ms 延迟
delay150() AnimatedBuilder
delay-150 - 150ms 延迟
delay200() AnimatedBuilder
delay-200 - 200ms 延迟
delay300() AnimatedBuilder
delay-300 - 300ms 延迟
delay500() AnimatedBuilder
delay-500 - 500ms 延迟
delay700() AnimatedBuilder
delay-700 - 700ms 延迟
delay75() AnimatedBuilder
delay-75 - 75ms 延迟
delayMs(int milliseconds) AnimatedBuilder
delay-{number}ms - 设置动画延迟时间(毫秒)
delayS(int seconds) AnimatedBuilder
delay-{number}s - 设置动画延迟时间(秒)
duration(Duration duration) AnimatedBuilder
duration-{time} - 设置动画持续时间 ✅ 支持:通过 Duration 实现
durationMs(int milliseconds) AnimatedBuilder
duration-{number}ms - 设置动画持续时间(毫秒)
durationS(int seconds) AnimatedBuilder
duration-{number}s - 设置动画持续时间(秒)
easeIn() AnimatedBuilder
ease-in - 缓入动画
easeInOut() AnimatedBuilder
ease-in-out - 缓入缓出动画
easeLinear() AnimatedBuilder
ease-linear - 线性动画
easeOut() AnimatedBuilder
ease-out - 缓出动画
foregroundDecoration(Decoration? foregroundDecoration) AnimatedBuilder
设置前景装饰
getDelay() Duration
获取延迟时间 ⚠️ 注意:AnimatedContainer 不支持 delay 参数 此方法返回设置的延迟值,可用于配合 AnimationController 实现延迟效果
height(double? height) AnimatedBuilder
设置高度
margin(EdgeInsetsGeometry? margin) AnimatedBuilder
设置外边距
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
padding(EdgeInsetsGeometry? padding) AnimatedBuilder
设置内边距
toString() String
A string representation of this object.
inherited
transform(Matrix4? transform) AnimatedBuilder
设置变换
transformAlignment(AlignmentGeometry? transformAlignment) AnimatedBuilder
设置变换对齐
width(double? width) AnimatedBuilder
设置宽度

Operators

operator ==(Object other) bool
The equality operator.
inherited