AnimatedSlot<T> constructor
- Key? key,
- required Signal<
T> connect, - required Widget to(
- BuildContext context,
- T value
- Duration duration = const Duration(milliseconds: 300),
- Curve curve = Curves.easeInOut,
- Curve? exitCurve,
- SlotEffect effect = SlotEffect.fade,
- DirectionalEffect? directionalEffect,
- Duration delay = Duration.zero,
- VoidCallback? onAnimationStart,
- VoidCallback? onAnimationComplete,
- Widget? child,
- double scaleBegin = 0.8,
- double scaleEnd = 1.0,
- Offset slideOffset = const Offset(0, 0.3),
- double rotationTurns = 0.25,
- double blurSigma = 5.0,
- bool clipBehavior = false,
Creates an AnimatedSlot that smoothly animates between value changes.
Basic Usage
AnimatedSlot<int>(
connect: controller.counter,
to: (ctx, val) => Text('$val'),
)
With Effects
AnimatedSlot<int>(
connect: controller.counter,
effect: SlotEffect.fadeScale | SlotEffect.blur,
duration: Duration(milliseconds: 400),
curve: Curves.elasticOut,
to: (ctx, val) => Text('$val', style: TextStyle(fontSize: 48)),
)
Direction-Aware
AnimatedSlot<int>(
connect: controller.counter,
directionalEffect: DirectionalEffect.vertical, // slides up/down
to: (ctx, val) => Text('$val'),
)
Implementation
const AnimatedSlot({
super.key,
required this.connect,
required this.to,
this.duration = const Duration(milliseconds: 300),
this.curve = Curves.easeInOut,
this.exitCurve,
this.effect = SlotEffect.fade,
this.directionalEffect,
this.delay = Duration.zero,
this.onAnimationStart,
this.onAnimationComplete,
this.child,
// Enhanced defaults
this.scaleBegin = 0.8,
this.scaleEnd = 1.0,
this.slideOffset = const Offset(0, 0.3),
this.rotationTurns = 0.25,
this.blurSigma = 5.0,
this.clipBehavior = false,
});