lerp property

LerpCallback<T> lerp
final

A function to use for linear interpolation between values.

{@tool snippet} Rather than creating a LerpCallback for the animation, consider using the predefined function for that type. For example, Color.lerp can be used for a ValueAnimation<Color>.

class _MyState extends State<StatefulWidget> with SingleTickerProviderMixin {
  late final ValueAnimation<Color> colorAnimation = ValueAnimation<Color>(
    tickerProvider: this,
    initialValue: Colors.black,
    duration: Durations.medium1,
    lerp: Color.lerp,
  );

  // ...
}

{@end-tool}

Implementation

final LerpCallback<T> lerp;