You can build one-off custom effects using CustomEffect. It requires a builder function that accepts (context, value, child). The value is a double (typically 0.0 to 1.0) representing the current animation progress.
// Custom effect adding a background and color lerp
Text("Hello World").animate().custom(
duration: 300.ms,
builder: (context, value, child) => Container(
color: Color.lerp(Colors.red, Colors.blue, value),
padding: EdgeInsets.all(8),
child: child, // the target widget
),
)
// Using Animate without a child to build a standalone widget
Animate().custom(
duration: 10.seconds,
begin: 10,
end: 0,
builder: (_, value, __) => Text(value.round()),
).fadeOut()