setupValue<T> method
void
setupValue<T>({
- required String key,
- required ValueGetter<
T> value, - required bool forward(
- T value
Implementation
void setupValue<T>({
required String key,
required ValueGetter<T> value,
required bool Function(T value) forward,
}) {
var oldValue = value();
AnimationDirection computeDirection() {
final newValue = value();
return oldValue != newValue
? forward(oldValue = newValue)
? AnimationDirection.forward
: AnimationDirection.reverse
: AnimationDirection.unchanged;
}
_data[key] = _AnimationData(computeDirection, AnimationDirection.unchanged,
forward(oldValue) ? _controller.upperBound : _controller.lowerBound);
}