animateTo method

TickerFuture animateTo(
  1. T target, {
  2. T? from,
  3. Duration? duration,
  4. Curve? curve,
})

Triggers an animation, and returns a TickerFuture that completes when it finishes.

// using the .animateTo() method
_animation.animateTo(
  target: newValue,
  duration: Durations.medium1,
  curve: Curves.ease,
);

// equivalent to:
_animation
  ..duration = Durations.medium1
  ..curve = Curves.ease
  ..value = newValue;

Implementation

TickerFuture animateTo(T target, {T? from, Duration? duration, Curve? curve}) {
  return _hooked.animateTo(target, from: from, duration: duration, curve: curve);
}