slide method
GetAnimatedBuilder
slide({
- required OffsetBuilder offset,
- double begin = 0,
- double end = 1,
- Duration duration = _defaultDuration,
- Duration delay = _defaultDelay,
- ValueSetter<
AnimationController> ? onComplete, - bool isSequential = false,
- bool autoPlayOnUpdate = false,
Translates/slides the widget dynamically using an offset builder.
The offset callback is invoked on every animation frame with the
current tweened value (interpolated from begin to end) as its second
parameter, and must use that value to produce the translation for that
frame. Returning a constant Offset results in no visible motion.
// Slides the widget 25 logical pixels downward.
Text('Hello').slide(
offset: (context, value) => Offset(0, 25 * value),
);
offsetCallback that builds the slide offset from the current animation value.beginStarting interpolation value.endEnding interpolation value.durationThe duration of the slide transition.delayThe delay duration before sliding starts.onCompleteA callback triggered when the animation completes.isSequentialIf true, starts this animation after the previous one in the chain completes.autoPlayOnUpdateIf true, replays the animation when rebuilt with a different tween.
Implementation
GetAnimatedBuilder slide({
required OffsetBuilder offset,
double begin = 0,
double end = 1,
Duration duration = _defaultDuration,
Duration delay = _defaultDelay,
ValueSetter<AnimationController>? onComplete,
bool isSequential = false,
bool autoPlayOnUpdate = false,
}) {
return SlideAnimation(
duration: duration,
delay: _getDelay(isSequential, delay),
begin: begin,
end: end,
onComplete: onComplete,
offsetBuild: offset,
autoPlayOnUpdate: autoPlayOnUpdate,
child: this,
);
}