animateTo method
Future<void>
animateTo(
- TimeRange newValue, {
- Curve curve = Curves.easeInOut,
- Duration duration = const Duration(milliseconds: 200),
- required TickerProvider vsync,
Implementation
Future<void> animateTo(
TimeRange newValue, {
Curve curve = Curves.easeInOut,
Duration duration = const Duration(milliseconds: 200),
required TickerProvider vsync,
}) async {
assert(_isValidRange(newValue));
cancelAnimation();
final previousRange = value;
_animationController =
AnimationController(debugLabel: 'TimeController', vsync: vsync)
..addListener(() {
value = TimeRange.lerp(
previousRange,
newValue,
_animationController!.value,
);
})
..animateTo(1, duration: duration, curve: curve);
}