value property

  1. @override
double value
override

The current value of the animation.

Implementation

@override
double get value {
  final Curve? activeCurve = _useForwardCurve ? curve : reverseCurve;

  final double t = parent.value;
  if (activeCurve == null) {
    return t;
  }
  if (t == 0.0 || t == 1.0) {
    assert(() {
      final double transformedValue = activeCurve.transform(t);
      final double roundedTransformedValue = transformedValue.round().toDouble();
      if (roundedTransformedValue != t) {
        throw FlutterError(
          'Invalid curve endpoint at $t.\n'
          'Curves must map 0.0 to near zero and 1.0 to near one but '
          '${activeCurve.runtimeType} mapped $t to $transformedValue, which '
          'is near $roundedTransformedValue.',
        );
      }
      return true;
    }());
    return t;
  }
  return activeCurve.transform(t);
}